diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/LineTrackingStringBuffer.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/LineTrackingStringBuffer.cs index 2af16c0481..a235bb482b 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/LineTrackingStringBuffer.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/LineTrackingStringBuffer.cs @@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public SourceLocation EndLocation { - get { return new SourceLocation(_filePath, Length, _lines.Count - 1, Length); } + get { return new SourceLocation(_filePath, Length, _lines.Count - 1, _lines[_lines.Count - 1].Length); } } public CharacterReference CharAt(int absoluteIndex)