diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs index df450defcb..50821f6fa0 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs @@ -4,8 +4,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -16,7 +14,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using StackFrame = Microsoft.AspNetCore.Diagnostics.Views.StackFrame; +using Microsoft.Extensions.StackTrace.Sources; namespace Microsoft.AspNetCore.Diagnostics { @@ -27,10 +25,9 @@ namespace Microsoft.AspNetCore.Diagnostics { private readonly RequestDelegate _next; private readonly DeveloperExceptionPageOptions _options; - private static readonly bool IsMono = Type.GetType("Mono.Runtime") != null; private readonly ILogger _logger; private readonly IFileProvider _fileProvider; - private readonly DiagnosticSource _diagnosticSource; + private readonly System.Diagnostics.DiagnosticSource _diagnosticSource; /// /// Initializes a new instance of the class @@ -45,7 +42,7 @@ namespace Microsoft.AspNetCore.Diagnostics IOptions options, ILoggerFactory loggerFactory, IHostingEnvironment hostingEnvironment, - DiagnosticSource diagnosticSource) + System.Diagnostics.DiagnosticSource diagnosticSource) { if (next == null) { @@ -122,7 +119,7 @@ namespace Microsoft.AspNetCore.Diagnostics private Task DisplayCompilationException( HttpContext context, - ICompilationException compilationException) + ICompilationException compilationException) { var model = new CompilationErrorPageModel { @@ -187,75 +184,40 @@ namespace Microsoft.AspNetCore.Diagnostics { for (var scan = ex; scan != null; scan = scan.InnerException) { + var stackTrace = ex.StackTrace; yield return new ErrorDetails { Error = scan, - StackFrames = StackFrames(scan) + StackFrames = StackTraceHelper.GetFrames(ex) + .Select(frame => GetStackFrame(frame.Method, frame.FilePath, frame.LineNumber)) }; - } - } - - private IEnumerable StackFrames(Exception ex) - { - var stackTrace = ex.StackTrace; - if (!string.IsNullOrEmpty(stackTrace)) - { - var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + Environment.NewLine.Length }; - for (var line = heap.Advance(Environment.NewLine); line.HasValue; line = heap.Advance(Environment.NewLine)) - { - yield return StackFrame(line); - } - } - } - - private StackFrame StackFrame(Chunk line) - { - line.Advance(" at "); - string function = line.Advance(" in ").ToString(); - - //exception message line format differences in .net and mono - //On .net : at ConsoleApplication.Program.Main(String[] args) in D:\Program.cs:line 16 - //On Mono : at ConsoleApplication.Program.Main(String[] args) in d:\Program.cs:16 - string file = !IsMono ? - line.Advance(":line ").ToString() : - line.Advance(":").ToString(); - - int lineNumber = line.ToInt32(); - - if (string.IsNullOrEmpty(file)) - { - return GetStackFrame( - // Handle stack trace lines like - // "--- End of stack trace from previous location where exception from thrown ---" - string.IsNullOrEmpty(function) ? line.ToString() : function, - file: string.Empty, - lineNumber: 0); - } - else - { - return GetStackFrame(function, file, lineNumber); - } + }; } // make it internal to enable unit testing - internal StackFrame GetStackFrame(string function, string file, int lineNumber) + internal StackFrame GetStackFrame(string method, string filePath, int lineNumber) { - var frame = new StackFrame { Function = function, File = file, Line = lineNumber }; - - if (string.IsNullOrEmpty(file)) + var stackFrame = new StackFrame { - return frame; + Function = method, + File = filePath, + Line = lineNumber + }; + + if (string.IsNullOrEmpty(stackFrame.File)) + { + return stackFrame; } IEnumerable lines = null; - if (File.Exists(file)) + if (File.Exists(stackFrame.File)) { - lines = File.ReadLines(file); + lines = File.ReadLines(stackFrame.File); } else { // Handle relative paths and embedded files - var fileInfo = _fileProvider.GetFileInfo(file); + var fileInfo = _fileProvider.GetFileInfo(stackFrame.File); if (fileInfo.Exists) { // ReadLines doesn't accept a stream. Use ReadLines as its more efficient @@ -273,10 +235,10 @@ namespace Microsoft.AspNetCore.Diagnostics if (lines != null) { - ReadFrameContent(frame, lines, lineNumber, lineNumber); + ReadFrameContent(stackFrame, lines, stackFrame.Line, stackFrame.Line); } - return frame; + return stackFrame; } // make it internal to enable unit testing @@ -319,42 +281,5 @@ namespace Microsoft.AspNetCore.Diagnostics } } } - - internal class Chunk - { - public string Text { get; set; } - public int Start { get; set; } - public int End { get; set; } - - public bool HasValue => Text != null; - - public Chunk Advance(string delimiter) - { - int indexOf = HasValue ? Text.IndexOf(delimiter, Start, End - Start, StringComparison.Ordinal) : -1; - if (indexOf < 0) - { - return new Chunk(); - } - - var chunk = new Chunk { Text = Text, Start = Start, End = indexOf }; - Start = indexOf + delimiter.Length; - return chunk; - } - - public override string ToString() - { - return HasValue ? Text.Substring(Start, End - Start) : string.Empty; - } - - public int ToInt32() - { - int value; - return HasValue && int.TryParse( - Text.Substring(Start, End - Start), - NumberStyles.Integer, - CultureInfo.InvariantCulture, - out value) ? value : 0; - } - } } } diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs index 99cc4bf96e..09060ca945 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs @@ -124,22 +124,17 @@ WriteAttributeValue("", 512, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa #line 35 "ErrorPage.cshtml" - StackFrame firstFrame = null; - firstFrame = errorDetail.StackFrames.FirstOrDefault(); + var firstFrame = errorDetail.StackFrames.FirstOrDefault(); if (firstFrame != null) { location = firstFrame.Function; - }/* TODO: TargetSite is not defined - else if (errorDetail.Error.TargetSite != null && errorDetail.Error.TargetSite.DeclaringType != null) - { - location = errorDetail.Error.TargetSite.DeclaringType.FullName + "." + errorDetail.Error.TargetSite.Name; - }*/ + } #line default #line hidden -#line 46 "ErrorPage.cshtml" +#line 41 "ErrorPage.cshtml" if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File)) { @@ -148,33 +143,33 @@ WriteAttributeValue("", 512, CultureInfo.CurrentUICulture.TwoLetterISOLanguageNa #line hidden WriteLiteral("

"); -#line 49 "ErrorPage.cshtml" +#line 44 "ErrorPage.cshtml" Write(location); #line default #line hidden WriteLiteral(" in

\r\n"); -#line 50 "ErrorPage.cshtml" +#line 45 "ErrorPage.cshtml" } else if (!string.IsNullOrEmpty(location)) { @@ -183,13 +178,13 @@ WriteAttributeValue("", 1890, firstFrame.File, 1890, 16, false); #line hidden WriteLiteral("

"); -#line 53 "ErrorPage.cshtml" +#line 48 "ErrorPage.cshtml" Write(location); #line default #line hidden WriteLiteral("

\r\n"); -#line 54 "ErrorPage.cshtml" +#line 49 "ErrorPage.cshtml" } else { @@ -198,13 +193,13 @@ WriteAttributeValue("", 1890, firstFrame.File, 1890, 16, false); #line hidden WriteLiteral("

"); -#line 57 "ErrorPage.cshtml" +#line 52 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_UnknownLocation); #line default #line hidden WriteLiteral("

\r\n"); -#line 58 "ErrorPage.cshtml" +#line 53 "ErrorPage.cshtml" } } @@ -212,44 +207,44 @@ WriteAttributeValue("", 1890, firstFrame.File, 1890, 16, false); #line hidden WriteLiteral("
    \r\n
  • \r\n "); -#line 62 "ErrorPage.cshtml" +#line 57 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_StackButton); #line default #line hidden WriteLiteral("\r\n
  • \r\n
  • \r\n "); -#line 65 "ErrorPage.cshtml" +#line 60 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_QueryButton); #line default #line hidden WriteLiteral("\r\n
  • \r\n
  • \r\n "); -#line 68 "ErrorPage.cshtml" +#line 63 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_CookiesButton); #line default #line hidden WriteLiteral("\r\n
  • \r\n
  • \r\n "); -#line 71 "ErrorPage.cshtml" +#line 66 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_HeadersButton); #line default #line hidden WriteLiteral("\r\n
  • \r\n
\r\n\r\n
\r\n
    \r\n"); -#line 77 "ErrorPage.cshtml" +#line 72 "ErrorPage.cshtml" #line default #line hidden -#line 77 "ErrorPage.cshtml" +#line 72 "ErrorPage.cshtml" int tabIndex = 6; #line default #line hidden WriteLiteral(" "); -#line 78 "ErrorPage.cshtml" +#line 73 "ErrorPage.cshtml" foreach (var errorDetail in Model.ErrorDetails) { @@ -257,25 +252,25 @@ WriteAttributeValue("", 1890, firstFrame.File, 1890, 16, false); #line hidden WriteLiteral("
  • \r\n

    "); -#line 81 "ErrorPage.cshtml" +#line 76 "ErrorPage.cshtml" Write(errorDetail.Error.GetType().Name); #line default #line hidden WriteLiteral(": "); -#line 81 "ErrorPage.cshtml" +#line 76 "ErrorPage.cshtml" Write(errorDetail.Error.Message); #line default #line hidden WriteLiteral("

    \r\n
      \r\n"); -#line 83 "ErrorPage.cshtml" +#line 78 "ErrorPage.cshtml" #line default #line hidden -#line 83 "ErrorPage.cshtml" +#line 78 "ErrorPage.cshtml" foreach (var frame in errorDetail.StackFrames) { @@ -283,28 +278,28 @@ WriteAttributeValue("", 1890, firstFrame.File, 1890, 16, false); #line hidden WriteLiteral("
    • "); -#line 104 "ErrorPage.cshtml" +#line 99 "ErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
    • \r\n"); -#line 105 "ErrorPage.cshtml" +#line 100 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 107 "ErrorPage.cshtml" +#line 102 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("\r\n
\r\n"); -#line 126 "ErrorPage.cshtml" +#line 121 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 128 "ErrorPage.cshtml" +#line 123 "ErrorPage.cshtml" } #line default @@ -538,26 +533,26 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false);
");
-#line 138 "ErrorPage.cshtml"
+#line 133 "ErrorPage.cshtml"
                                 Write(errorDetail.Error.ToString());
 
 #line default
 #line hidden
             WriteLiteral("
\r\n
\r\n \r\n \r\n"); -#line 142 "ErrorPage.cshtml" +#line 137 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n\r\n
\r\n"); -#line 147 "ErrorPage.cshtml" +#line 142 "ErrorPage.cshtml" #line default #line hidden -#line 147 "ErrorPage.cshtml" +#line 142 "ErrorPage.cshtml" if (Model.Query.Any()) { @@ -565,25 +560,25 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 157 "ErrorPage.cshtml" +#line 152 "ErrorPage.cshtml" #line default #line hidden -#line 157 "ErrorPage.cshtml" +#line 152 "ErrorPage.cshtml" foreach (var kv in Model.Query.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -593,19 +588,19 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 165 "ErrorPage.cshtml" +#line 160 "ErrorPage.cshtml" } } @@ -613,7 +608,7 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n
"); -#line 152 "ErrorPage.cshtml" +#line 147 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 153 "ErrorPage.cshtml" +#line 148 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
"); -#line 162 "ErrorPage.cshtml" +#line 157 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 163 "ErrorPage.cshtml" +#line 158 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
\r\n"); -#line 169 "ErrorPage.cshtml" +#line 164 "ErrorPage.cshtml" } else { @@ -622,26 +617,26 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral("

"); -#line 172 "ErrorPage.cshtml" +#line 167 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoQueryStringData); #line default #line hidden WriteLiteral("

\r\n"); -#line 173 "ErrorPage.cshtml" +#line 168 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n\r\n
\r\n"); -#line 177 "ErrorPage.cshtml" +#line 172 "ErrorPage.cshtml" #line default #line hidden -#line 177 "ErrorPage.cshtml" +#line 172 "ErrorPage.cshtml" if (Model.Cookies.Any()) { @@ -649,25 +644,25 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 187 "ErrorPage.cshtml" +#line 182 "ErrorPage.cshtml" #line default #line hidden -#line 187 "ErrorPage.cshtml" +#line 182 "ErrorPage.cshtml" foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key)) { @@ -675,26 +670,26 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 193 "ErrorPage.cshtml" +#line 188 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n
"); -#line 182 "ErrorPage.cshtml" +#line 177 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 183 "ErrorPage.cshtml" +#line 178 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
"); -#line 190 "ErrorPage.cshtml" +#line 185 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 191 "ErrorPage.cshtml" +#line 186 "ErrorPage.cshtml" Write(kv.Value); #line default #line hidden WriteLiteral("
\r\n"); -#line 196 "ErrorPage.cshtml" +#line 191 "ErrorPage.cshtml" } else { @@ -703,26 +698,26 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral("

"); -#line 199 "ErrorPage.cshtml" +#line 194 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoCookieData); #line default #line hidden WriteLiteral("

\r\n"); -#line 200 "ErrorPage.cshtml" +#line 195 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n
\r\n"); -#line 203 "ErrorPage.cshtml" +#line 198 "ErrorPage.cshtml" #line default #line hidden -#line 203 "ErrorPage.cshtml" +#line 198 "ErrorPage.cshtml" if (Model.Headers.Any()) { @@ -730,25 +725,25 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"); -#line 213 "ErrorPage.cshtml" +#line 208 "ErrorPage.cshtml" #line default #line hidden -#line 213 "ErrorPage.cshtml" +#line 208 "ErrorPage.cshtml" foreach (var kv in Model.Headers.OrderBy(kv => kv.Key)) { foreach (var v in kv.Value) @@ -758,19 +753,19 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 221 "ErrorPage.cshtml" +#line 216 "ErrorPage.cshtml" } } @@ -778,7 +773,7 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral(" \r\n
"); -#line 208 "ErrorPage.cshtml" +#line 203 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(""); -#line 209 "ErrorPage.cshtml" +#line 204 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral("
"); -#line 218 "ErrorPage.cshtml" +#line 213 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(""); -#line 219 "ErrorPage.cshtml" +#line 214 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral("
\r\n"); -#line 225 "ErrorPage.cshtml" +#line 220 "ErrorPage.cshtml" } else { @@ -787,13 +782,13 @@ WriteAttributeValue("", 5163, frame.Line + 1, 5163, 17, false); #line hidden WriteLiteral("

"); -#line 228 "ErrorPage.cshtml" +#line 223 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoHeaderData); #line default #line hidden WriteLiteral("

\r\n"); -#line 229 "ErrorPage.cshtml" +#line 224 "ErrorPage.cshtml" } #line default diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml index 7c13371cd3..05ed5d9954 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml @@ -33,16 +33,11 @@ {
@errorDetail.Error.GetType().Name: @{ Output.Write(HtmlEncodeAndReplaceLineBreaks(errorDetail.Error.Message)); }
@{ - StackFrame firstFrame = null; - firstFrame = errorDetail.StackFrames.FirstOrDefault(); + var firstFrame = errorDetail.StackFrames.FirstOrDefault(); if (firstFrame != null) { location = firstFrame.Function; - }/* TODO: TargetSite is not defined - else if (errorDetail.Error.TargetSite != null && errorDetail.Error.TargetSite.DeclaringType != null) - { - location = errorDetail.Error.TargetSite.DeclaringType.FullName + "." + errorDetail.Error.TargetSite.Name; - }*/ + } } if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File)) { diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/StackFrameInfo.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/StackFrameInfo.cs new file mode 100644 index 0000000000..689cd43af0 --- /dev/null +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/StackFrameInfo.cs @@ -0,0 +1,54 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.AspNetCore.Diagnostics.Views +{ + /// + /// Detailed exception stack information used to generate a view + /// + public class StackFrameInfo + { + /// + /// Function containing instruction + /// + public string Function { get; set; } + + /// + /// File containing the instruction + /// + public string File { get; set; } + + /// + /// The line number of the instruction + /// + public int Line { get; set; } + + /// + /// The line preceeding the frame line + /// + public int PreContextLine { get; set; } + + /// + /// Lines of code before the actual error line(s). + /// + public IEnumerable PreContextCode { get; set; } = Enumerable.Empty(); + + /// + /// Line(s) of code responsible for the error. + /// + public IEnumerable ContextCode { get; set; } = Enumerable.Empty(); + + /// + /// Lines of code after the actual error line(s). + /// + public IEnumerable PostContextCode { get; set; } = Enumerable.Empty(); + + /// + /// Specific error details for this stack frame. + /// + public string ErrorDetails { get; set; } + } +} diff --git a/src/Microsoft.AspNetCore.Diagnostics/project.json b/src/Microsoft.AspNetCore.Diagnostics/project.json index aa8bc215c2..9e3ddd8465 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/project.json +++ b/src/Microsoft.AspNetCore.Diagnostics/project.json @@ -31,12 +31,18 @@ "Microsoft.Extensions.FileProviders.Physical": "1.0.0-*", "Microsoft.Extensions.Logging.Abstractions": "1.0.0-*", "Microsoft.Extensions.Options": "1.0.0-*", - "System.Diagnostics.DiagnosticSource": "4.0.0-*" + "Microsoft.Extensions.StackTrace.Sources": { + "type": "build", + "version": "1.0.0-*" + }, + "System.Diagnostics.DiagnosticSource": "4.0.0-*", + "System.Reflection.Metadata": "1.3.0-*" }, "frameworks": { "net451": {}, - "netstandard1.3": { + "netstandard1.5": { "dependencies": { + "System.Diagnostics.StackTrace": "4.0.1-*", "System.Reflection.Extensions": "4.0.1-*" } } diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/DeveloperExceptionPageMiddlewareTest.cs b/test/Microsoft.AspNetCore.Diagnostics.Tests/DeveloperExceptionPageMiddlewareTest.cs index 424750920b..4b84444581 100644 --- a/test/Microsoft.AspNetCore.Diagnostics.Tests/DeveloperExceptionPageMiddlewareTest.cs +++ b/test/Microsoft.AspNetCore.Diagnostics.Tests/DeveloperExceptionPageMiddlewareTest.cs @@ -8,7 +8,6 @@ using System.IO; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; -using System.Runtime.Versioning; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -16,14 +15,13 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.AspNetCore.Testing; -using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; -using Xunit; -using StackFrame = Microsoft.AspNetCore.Diagnostics.Views.StackFrame; using Moq; +using Xunit; namespace Microsoft.AspNetCore.Diagnostics { @@ -273,7 +271,7 @@ namespace Microsoft.AspNetCore.Diagnostics { // Arrange var middleware = GetErrorPageMiddleware(); - var stackFrame = new StackFrame(); + var stackFrame = new Views.StackFrame(); // Act middleware.ReadFrameContent(