From 1e1e55b362fd8bc1e192993f1d630587a1b46810 Mon Sep 17 00:00:00 2001 From: turchenkoalex Date: Sun, 13 Jul 2014 21:14:05 +0400 Subject: [PATCH] Fix not shown 'exception page' on non windows system Occurs on non windows system where Environment.NewLine is LF (1 symbol length) Unix, Linux, OS X etc. And options.ShowExceptionDetails is true. Replaced number '2' to Environment.NewLine.Length. --- src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs index e6d56a030d..fda85f4f25 100644 --- a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs @@ -126,7 +126,7 @@ namespace Microsoft.AspNet.Diagnostics var stackTrace = ex.StackTrace; if (!string.IsNullOrEmpty(stackTrace)) { - var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + 2 }; + var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + Environment.NewLine.Length }; for (Chunk line = heap.Advance(Environment.NewLine); line.HasValue; line = heap.Advance(Environment.NewLine)) { yield return StackFrame(line, showSource);