From 9da95d620c68b9ce91803f38c789c78ace4c3655 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 7 Apr 2015 17:29:13 -0700 Subject: [PATCH] Reacting to ICompilationMessage line indexes changing to be 1-based --- src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs index aa8851bcc0..703149e518 100644 --- a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs @@ -112,18 +112,16 @@ namespace Microsoft.AspNet.Diagnostics foreach (var item in failedCompilationFile.Messages) { - // Convert 0-based line indexes to 1-based index that the StackFrame expects - var lineIndex = item.StartLine + 1; var frame = new StackFrame { File = failedCompilationFile.SourceFilePath, - Line = lineIndex, + Line = item.StartLine, Function = string.Empty }; if (_options.ShowSourceCode) { - ReadFrameContent(frame, fileContent, lineIndex, item.EndLine + 1); + ReadFrameContent(frame, fileContent, item.StartLine, item.EndLine); frame.ErrorDetails = item.Message; }