diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs index 37c319cc49..36dd78084d 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cs @@ -25,12 +25,18 @@ using System.Net #line hidden ; #line 5 "ErrorPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Views +using System.Reflection #line default #line hidden ; #line 6 "ErrorPage.cshtml" +using Microsoft.AspNetCore.Diagnostics.Views + +#line default +#line hidden + ; +#line 7 "ErrorPage.cshtml" using Microsoft.AspNetCore.Diagnostics #line default @@ -40,7 +46,7 @@ using Microsoft.AspNetCore.Diagnostics public class ErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView { -#line 8 "ErrorPage.cshtml" +#line 9 "ErrorPage.cshtml" public ErrorPage(ErrorPageModel model) { @@ -59,7 +65,7 @@ using Microsoft.AspNetCore.Diagnostics #pragma warning disable 1998 public override async Task ExecuteAsync() { -#line 16 "ErrorPage.cshtml" +#line 17 "ErrorPage.cshtml" // TODO: Response.ReasonPhrase = "Internal Server Error"; Response.ContentType = "text/html; charset=utf-8"; @@ -69,33 +75,33 @@ using Microsoft.AspNetCore.Diagnostics #line hidden WriteLiteral("\r\n\r\n
\r\n \r\n"); -#line 44 "ErrorPage.cshtml" - Write(location); + WriteLiteral("
");
+#line 45 "ErrorPage.cshtml"
+ Write(location);
#line default
#line hidden
WriteLiteral(" in ");
-#line 44 "ErrorPage.cshtml"
- Write(System.IO.Path.GetFileName(firstFrame.File));
+#line 45 "ErrorPage.cshtml"
+ Write(System.IO.Path.GetFileName(firstFrame.File));
#line default
#line hidden
WriteLiteral(", line ");
-#line 44 "ErrorPage.cshtml"
- Write(firstFrame.Line);
+#line 45 "ErrorPage.cshtml"
+ Write(firstFrame.Line);
#line default
#line hidden
WriteLiteral("
"); -#line 48 "ErrorPage.cshtml" - Write(location); + WriteLiteral("
"); +#line 49 "ErrorPage.cshtml" + Write(location); #line default #line hidden WriteLiteral("
\r\n"); -#line 49 "ErrorPage.cshtml" +#line 50 "ErrorPage.cshtml" } else { @@ -192,59 +198,113 @@ WriteAttributeValue("", 1528, firstFrame.File, 1528, 16, false); #line default #line hidden - WriteLiteral(""); -#line 52 "ErrorPage.cshtml" - Write(Resources.ErrorPageHtml_UnknownLocation); + WriteLiteral("
"); +#line 53 "ErrorPage.cshtml" + Write(Resources.ErrorPageHtml_UnknownLocation); #line default #line hidden WriteLiteral("
\r\n"); -#line 53 "ErrorPage.cshtml" +#line 54 "ErrorPage.cshtml" } } +#line default +#line hidden + + WriteLiteral(" "); +#line 56 "ErrorPage.cshtml" + + var reflectionTypeLoadException = Model.ErrorDetails.Last()?.Error as ReflectionTypeLoadException; + if (reflectionTypeLoadException != null) + { + if (reflectionTypeLoadException.LoaderExceptions.Length > 0) + { + +#line default +#line hidden + + WriteLiteral("");
-#line 88 "ErrorPage.cshtml"
+#line 105 "ErrorPage.cshtml"
Write(System.IO.Path.GetFileName(frame.File));
#line default
#line hidden
WriteLiteral("");
-#line 133 "ErrorPage.cshtml"
+#line 150 "ErrorPage.cshtml"
Write(errorDetail.Error.ToString());
#line default
#line hidden
WriteLiteral("\r\n | "); -#line 147 "ErrorPage.cshtml" +#line 164 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(" | \r\n"); -#line 148 "ErrorPage.cshtml" +#line 165 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral(" | \r\n
|---|---|
| "); -#line 157 "ErrorPage.cshtml" +#line 174 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(" | \r\n"); -#line 158 "ErrorPage.cshtml" +#line 175 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral(" | \r\n
"); -#line 167 "ErrorPage.cshtml" +#line 184 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoQueryStringData); #line default #line hidden WriteLiteral("
\r\n"); -#line 168 "ErrorPage.cshtml" +#line 185 "ErrorPage.cshtml" } #line default #line hidden WriteLiteral("| "); -#line 203 "ErrorPage.cshtml" +#line 220 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_VariableColumn); #line default #line hidden WriteLiteral(" | \r\n"); -#line 204 "ErrorPage.cshtml" +#line 221 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_ValueColumn); #line default #line hidden WriteLiteral(" | \r\n
|---|---|
| "); -#line 213 "ErrorPage.cshtml" +#line 230 "ErrorPage.cshtml" Write(kv.Key); #line default #line hidden WriteLiteral(" | \r\n"); -#line 214 "ErrorPage.cshtml" +#line 231 "ErrorPage.cshtml" Write(v); #line default #line hidden WriteLiteral(" | \r\n
"); -#line 223 "ErrorPage.cshtml" +#line 240 "ErrorPage.cshtml" Write(Resources.ErrorPageHtml_NoHeaderData); #line default #line hidden WriteLiteral("
\r\n"); -#line 224 "ErrorPage.cshtml" +#line 241 "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 05ed5d9954..43d1b876e2 100644 --- a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml +++ b/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml @@ -1,7 +1,8 @@ -@using System +@using System @using System.Globalization @using System.Linq @using System.Net +@using System.Reflection @using Microsoft.AspNetCore.Diagnostics.Views @using Microsoft.AspNetCore.Diagnostics @functions @@ -41,15 +42,31 @@ } if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File)) { -@location in @System.IO.Path.GetFileName(firstFrame.File), line @firstFrame.Line
@location in @System.IO.Path.GetFileName(firstFrame.File), line @firstFrame.Line
@location
+@location
} else { -@Resources.ErrorPageHtml_UnknownLocation
+@Resources.ErrorPageHtml_UnknownLocation
+ } + } + @{ + var reflectionTypeLoadException = Model.ErrorDetails.Last()?.Error as ReflectionTypeLoadException; + if (reflectionTypeLoadException != null) + { + if (reflectionTypeLoadException.LoaderExceptions.Length > 0) + { +