Deleted obsolete razor views and models

This commit is contained in:
Kiran Challa 2017-04-17 13:43:26 -07:00
parent 775847a1fa
commit e450dd707e
18 changed files with 80 additions and 2842 deletions

View File

@ -1,367 +0,0 @@
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views
{
#line 1 "DatabaseErrorPage.cshtml"
using System
#line default
#line hidden
;
#line 2 "DatabaseErrorPage.cshtml"
using System.Linq
#line default
#line hidden
;
#line 3 "DatabaseErrorPage.cshtml"
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
#line default
#line hidden
;
#line 4 "DatabaseErrorPage.cshtml"
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views
#line default
#line hidden
;
using System.Threading.Tasks;
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class DatabaseErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView
{
#line 11 "DatabaseErrorPage.cshtml"
public DatabaseErrorPageModel Model { get; set; }
public string UrlEncode(string content)
{
return UrlEncoder.Encode(content);
}
public string JavaScriptEncode(string content)
{
return JavaScriptEncoder.Encode(content);
}
#line default
#line hidden
#line hidden
public DatabaseErrorPage()
{
}
#pragma warning disable 1998
public override async Task ExecuteAsync()
{
#line 5 "DatabaseErrorPage.cshtml"
Response.StatusCode = 500;
Response.ContentType = "text/html";
Response.ContentLength = null; // Clear any prior Content-Length
#line default
#line hidden
WriteLiteral("<!DOCTYPE html>\r\n\r\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n <meta charset=\"utf-8\" />\r\n <title>Internal Server Error</title>\r\n <style>\r\n body {\r\n font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;\r\n font-size: .813em;\r\n line-height: 1.4em;\r\n color: #222;\r\n}\r\n\r\nh1, h2, h3, h4, h5 {\r\n font-weight: 100;\r\n}\r\n\r\nh1 {\r\n color: #44525e;\r\n margin: 15px 0 15px 0;\r\n}\r\n\r\nh2 {\r\n margin: 10px 5px 0 0;\r\n}\r\n\r\nh3 {\r\n color: #363636;\r\n margin: 5px 5px 0 0;\r\n}\r\n\r\ncode {\r\n font-family: Consolas, \"Courier New\", courier, monospace;\r\n}\r\n\r\na {\r\n color: #1ba1e2;\r\n text-decoration: none;\r\n}\r\n\r\n a:hover {\r\n color: #13709e;\r\n text-decoration: underline;\r\n }\r\n\r\nhr {\r\n border: 1px #ddd solid;\r\n}\r\n\r\nbody .titleerror {\r\n padding: 3px;\r\n}\r\n\r\n#applyMigrations {\r\n font-size: 14px;\r\n background: #44c5f2;\r\n color: #ffffff;\r\n display: inline-block;\r\n padding: 6px 12px;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n white-space: nowrap;\r\n vertical-align: middle;\r\n cursor: pointer;\r\n border: 1px solid transparent;\r\n}\r\n\r\n #applyMigrations:disabled {\r\n background-color: #a9e4f9;\r\n border-color: #44c5f2;\r\n }\r\n\r\n.error {\r\n color: red;\r\n}\r\n\r\n.expanded {\r\n display: block;\r\n}\r\n\r\n.collapsed {\r\n display: none;\r\n}\r\n\r\n </style>\r\n</head>\r\n<body>\r\n <h1>");
#line 35 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_Title);
#line default
#line hidden
WriteLiteral("</h1>\r\n <p>\r\n");
#line 37 "DatabaseErrorPage.cshtml"
#line default
#line hidden
#line 37 "DatabaseErrorPage.cshtml"
for (Exception ex = Model.Exception; ex != null; ex = ex.InnerException)
{
#line default
#line hidden
WriteLiteral(" <span>");
#line 39 "DatabaseErrorPage.cshtml"
Write(ex.GetType().Name);
#line default
#line hidden
WriteLiteral(": ");
#line 39 "DatabaseErrorPage.cshtml"
Write(ex.Message);
#line default
#line hidden
WriteLiteral("</span>\r\n <br />\r\n");
#line 41 "DatabaseErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </p>\r\n <hr />\r\n\r\n");
#line 45 "DatabaseErrorPage.cshtml"
#line default
#line hidden
#line 45 "DatabaseErrorPage.cshtml"
if (!Model.DatabaseExists && !Model.PendingMigrations.Any())
{
#line default
#line hidden
WriteLiteral(" <h2>");
#line 47 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_NoDbOrMigrationsTitle(Model.ContextType.Name));
#line default
#line hidden
WriteLiteral("</h2>\r\n <p>");
#line 48 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_NoDbOrMigrationsInfoPMC);
#line default
#line hidden
WriteLiteral("</p>\r\n <code> ");
#line 49 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_AddMigrationCommandPMC);
#line default
#line hidden
WriteLiteral("</code>\r\n <br />\r\n <code> ");
#line 51 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC);
#line default
#line hidden
WriteLiteral("</code>\r\n <p>");
#line 52 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_NoDbOrMigrationsInfoCLI);
#line default
#line hidden
WriteLiteral("</p>\r\n <code> ");
#line 53 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_AddMigrationCommandCLI);
#line default
#line hidden
WriteLiteral("</code>\r\n <br />\r\n <code> ");
#line 55 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI);
#line default
#line hidden
WriteLiteral("</code>\r\n <hr />\r\n");
#line 57 "DatabaseErrorPage.cshtml"
}
else if (Model.PendingMigrations.Any())
{
#line default
#line hidden
WriteLiteral(" <div>\r\n <h2>");
#line 61 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_PendingMigrationsTitle(Model.ContextType.Name));
#line default
#line hidden
WriteLiteral("</h2>\r\n <p>");
#line 62 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_PendingMigrationsInfo(Model.ContextType.Name));
#line default
#line hidden
WriteLiteral("</p>\r\n\r\n <ul>\r\n");
#line 65 "DatabaseErrorPage.cshtml"
#line default
#line hidden
#line 65 "DatabaseErrorPage.cshtml"
foreach (var migration in Model.PendingMigrations)
{
#line default
#line hidden
WriteLiteral(" <li>");
#line 67 "DatabaseErrorPage.cshtml"
Write(migration);
#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 68 "DatabaseErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" </ul>\r\n\r\n <p>\r\n <button id=\"applyMigrations\" onclick=\"ApplyMigrations()\">");
#line 72 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsButton);
#line default
#line hidden
WriteLiteral(@"</button>
<span id=""applyMigrationsError"" class=""error""></span>
<span id=""applyMigrationsSuccess""></span>
</p>
<script>
function ApplyMigrations() {
applyMigrations.disabled = true;
applyMigrationsError.innerHTML = """";
applyMigrations.innerHTML = """);
#line 80 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonRunning));
#line default
#line hidden
WriteLiteral("\";\r\n\r\n var req = new XMLHttpRequest();\r\n\r\n req.onload = function (e) {\r\n if (req.status === 204) {\r\n applyMigrations.innerHTML = \"");
#line 86 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonDone));
#line default
#line hidden
WriteLiteral("\";\r\n applyMigrationsSuccess.innerHTML = \"");
#line 87 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(Strings.DatabaseErrorPage_MigrationsAppliedRefresh));
#line default
#line hidden
WriteLiteral(@""";
} else {
ErrorApplyingMigrations();
}
};
req.onerror = function (e) {
ErrorApplyingMigrations();
};
var formBody = ""context=");
#line 97 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(UrlEncode(Model.ContextType.AssemblyQualifiedName)));
#line default
#line hidden
WriteLiteral("\";\r\n req.open(\"POST\", \"");
#line 98 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(Model.Options.MigrationsEndPointPath.Value));
#line default
#line hidden
WriteLiteral(@""", true);
req.setRequestHeader(""Content-type"", ""application/x-www-form-urlencoded"");
req.setRequestHeader(""Content-length"", formBody.length);
req.setRequestHeader(""Connection"", ""close"");
req.send(formBody);
}
function ErrorApplyingMigrations() {
applyMigrations.innerHTML = """);
#line 106 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButton));
#line default
#line hidden
WriteLiteral("\";\r\n applyMigrationsError.innerHTML = \"");
#line 107 "DatabaseErrorPage.cshtml"
Write(JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsFailed));
#line default
#line hidden
WriteLiteral("\";\r\n applyMigrations.disabled = false;\r\n }\r\n </script>\r\n\r\n <p>");
#line 112 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_HowToApplyFromPMC);
#line default
#line hidden
WriteLiteral("</p>\r\n <code>");
#line 113 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC);
#line default
#line hidden
WriteLiteral("</code>\r\n <p>");
#line 114 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_HowToApplyFromCLI);
#line default
#line hidden
WriteLiteral("</p>\r\n <code>");
#line 115 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI);
#line default
#line hidden
WriteLiteral("</code>\r\n <hr />\r\n </div>\r\n");
#line 118 "DatabaseErrorPage.cshtml"
}
else if (Model.PendingModelChanges)
{
#line default
#line hidden
WriteLiteral(" <div>\r\n <h2>");
#line 122 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name));
#line default
#line hidden
WriteLiteral("</h2>\r\n <p>");
#line 123 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_PendingChangesInfoPMC);
#line default
#line hidden
WriteLiteral("</p>\r\n <code>");
#line 124 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_AddMigrationCommandPMC);
#line default
#line hidden
WriteLiteral("</code>\r\n <br />\r\n <code>");
#line 126 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC);
#line default
#line hidden
WriteLiteral("</code>\r\n <p>");
#line 127 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_PendingChangesInfoCLI);
#line default
#line hidden
WriteLiteral("</p>\r\n <code>");
#line 128 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_AddMigrationCommandCLI);
#line default
#line hidden
WriteLiteral("</code>\r\n <br />\r\n <code>");
#line 130 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI);
#line default
#line hidden
WriteLiteral("</code>\r\n <hr />\r\n </div>\r\n");
#line 133 "DatabaseErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral("</body>\r\n</html>");
}
#pragma warning restore 1998
}
}

View File

@ -1,135 +0,0 @@
@using System
@using System.Linq
@using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
@using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views
@{
Response.StatusCode = 500;
Response.ContentType = "text/html";
Response.ContentLength = null; // Clear any prior Content-Length
}
@functions
{
public DatabaseErrorPageModel Model { get; set; }
public string UrlEncode(string content)
{
return UrlEncoder.Encode(content);
}
public string JavaScriptEncode(string content)
{
return JavaScriptEncoder.Encode(content);
}
}
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Internal Server Error</title>
<style>
<%$ include: ErrorPage.css %>
</style>
</head>
<body>
<h1>@Strings.DatabaseErrorPage_Title</h1>
<p>
@for (Exception ex = Model.Exception; ex != null; ex = ex.InnerException)
{
<span>@ex.GetType().Name: @ex.Message</span>
<br />
}
</p>
<hr />
@if (!Model.DatabaseExists && !Model.PendingMigrations.Any())
{
<h2>@Strings.FormatDatabaseErrorPage_NoDbOrMigrationsTitle(Model.ContextType.Name)</h2>
<p>@Strings.DatabaseErrorPage_NoDbOrMigrationsInfoPMC</p>
<code> @Strings.DatabaseErrorPage_AddMigrationCommandPMC</code>
<br />
<code> @Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC</code>
<p>@Strings.DatabaseErrorPage_NoDbOrMigrationsInfoCLI</p>
<code> @Strings.DatabaseErrorPage_AddMigrationCommandCLI</code>
<br />
<code> @Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI</code>
<hr />
}
else if (Model.PendingMigrations.Any())
{
<div>
<h2>@Strings.FormatDatabaseErrorPage_PendingMigrationsTitle(Model.ContextType.Name)</h2>
<p>@Strings.FormatDatabaseErrorPage_PendingMigrationsInfo(Model.ContextType.Name)</p>
<ul>
@foreach (var migration in Model.PendingMigrations)
{
<li>@migration</li>
}
</ul>
<p>
<button id="applyMigrations" onclick="ApplyMigrations()">@Strings.DatabaseErrorPage_ApplyMigrationsButton</button>
<span id="applyMigrationsError" class="error"></span>
<span id="applyMigrationsSuccess"></span>
</p>
<script>
function ApplyMigrations() {
applyMigrations.disabled = true;
applyMigrationsError.innerHTML = "";
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonRunning)";
var req = new XMLHttpRequest();
req.onload = function (e) {
if (req.status === 204) {
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonDone)";
applyMigrationsSuccess.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_MigrationsAppliedRefresh)";
} else {
ErrorApplyingMigrations();
}
};
req.onerror = function (e) {
ErrorApplyingMigrations();
};
var formBody = "context=@JavaScriptEncode(UrlEncode(Model.ContextType.AssemblyQualifiedName))";
req.open("POST", "@JavaScriptEncode(Model.Options.MigrationsEndPointPath.Value)", true);
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", formBody.length);
req.setRequestHeader("Connection", "close");
req.send(formBody);
}
function ErrorApplyingMigrations() {
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButton)";
applyMigrationsError.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsFailed)";
applyMigrations.disabled = false;
}
</script>
<p>@Strings.DatabaseErrorPage_HowToApplyFromPMC</p>
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC</code>
<p>@Strings.DatabaseErrorPage_HowToApplyFromCLI</p>
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI</code>
<hr />
</div>
}
else if (Model.PendingModelChanges)
{
<div>
<h2>@Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name)</h2>
<p>@Strings.DatabaseErrorPage_PendingChangesInfoPMC</p>
<code>@Strings.DatabaseErrorPage_AddMigrationCommandPMC</code>
<br />
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommandPMC</code>
<p>@Strings.DatabaseErrorPage_PendingChangesInfoCLI</p>
<code>@Strings.DatabaseErrorPage_AddMigrationCommandCLI</code>
<br />
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommandCLI</code>
<hr />
</div>
}
</body>
</html>

View File

@ -1,73 +0,0 @@
// 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 JetBrains.Annotations;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Utilities;
using System;
using System.Collections.Generic;
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views
{
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class DatabaseErrorPageModel
{
private readonly Type _contextType;
private readonly Exception _exception;
private readonly bool _databaseExists;
private readonly bool _pendingModelChanges;
private readonly IEnumerable<string> _pendingMigrations;
private readonly DatabaseErrorPageOptions _options;
public DatabaseErrorPageModel(
[NotNull] Type contextType,
[NotNull] Exception exception,
bool databaseExists,
bool pendingModelChanges,
[NotNull] IEnumerable<string> pendingMigrations,
[NotNull] DatabaseErrorPageOptions options)
{
Check.NotNull(contextType, "contextType");
Check.NotNull(exception, "exception");
Check.NotNull(pendingMigrations, "pendingMigrations");
Check.NotNull(options, "options");
_contextType = contextType;
_exception = exception;
_databaseExists = databaseExists;
_pendingModelChanges = pendingModelChanges;
_pendingMigrations = pendingMigrations;
_options = options;
}
public virtual Type ContextType
{
get { return _contextType; }
}
public virtual Exception Exception
{
get { return _exception; }
}
public virtual bool DatabaseExists
{
get { return _databaseExists; }
}
public virtual bool PendingModelChanges
{
get { return _pendingModelChanges; }
}
public virtual IEnumerable<string> PendingMigrations
{
get { return _pendingMigrations; }
}
public virtual DatabaseErrorPageOptions Options
{
get { return _options; }
}
}
}

View File

@ -0,0 +1,10 @@
[
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views.DatabaseErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views.DatabaseErrorPageModel",
"Kind": "Removal"
}
]

View File

@ -0,0 +1,10 @@
[
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views.DatabaseErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views.DatabaseErrorPageModel",
"Kind": "Removal"
}
]

View File

@ -1,26 +0,0 @@
// 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;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
namespace Microsoft.AspNetCore.Diagnostics.Views
{
/// <summary>
/// Holds data to be displayed on the compilation error page.
/// </summary>
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class CompilationErrorPageModel
{
/// <summary>
/// Options for what output to display.
/// </summary>
public DeveloperExceptionPageOptions Options { get; set; }
/// <summary>
/// Detailed information about each parse or compilation error.
/// </summary>
public IList<ErrorDetails> ErrorDetails { get; } = new List<ErrorDetails>();
}
}

View File

@ -1,100 +0,0 @@
@using System
@using System.Globalization
@using System.Linq
@using System.Net
@using Microsoft.AspNetCore.Diagnostics
@functions
{
public CompilationErrorPageModel Model { get; set; }
}
@{
Response.StatusCode = 500;
Response.ContentType = "text/html; charset=utf-8";
Response.ContentLength = null; // Clear any prior Content-Length
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@Resources.ErrorPageHtml_Title</title>
<style>
<%$ include: ErrorPage.css %>
</style>
</head>
<body>
<h1>@Resources.ErrorPageHtml_CompilationException</h1>
@foreach (var errorDetail in Model.ErrorDetails)
{
<div id="stackpage" class="page">
@{
var stackFrameCount = 0;
var frameId = "";
}
@{
var fileName = errorDetail.StackFrames.FirstOrDefault()?.File;
if (!string.IsNullOrEmpty(fileName))
{
<div class="titleerror">@fileName</div>
}
}
@if (!string.IsNullOrEmpty(errorDetail.ErrorMessage))
{
<div class="details">@errorDetail.ErrorMessage</div>
}
<br />
<ul>
@foreach (var frame in errorDetail.StackFrames)
{
@{
stackFrameCount++;
frameId = "frame" + stackFrameCount;
}
<li class="frame" id="@frameId">
@if (!string.IsNullOrEmpty(frame.ErrorDetails))
{
<h3>@frame.ErrorDetails</h3>
}
@if (frame.Line != 0 && frame.ContextCode.Any())
{
<button class="expandCollapseButton" data-frameId="@frameId">+</button>
<div class="source">
@if (frame.PreContextCode.Any())
{
<ol start="@frame.PreContextLine" class="collapsible">
@foreach (var line in frame.PreContextCode)
{
<li><span>@line</span></li>
}
</ol>
}
<ol start="@frame.Line" class="highlight">
@foreach (var line in frame.ContextCode)
{
<li><span>@line</span></li>
}
</ol>
@if (frame.PostContextCode.Any())
{
<ol start='@(frame.Line + 1)' class="collapsible">
@foreach (var line in frame.PostContextCode)
{
<li><span>@line</span></li>
}
</ol>
}
</div>
}
</li>
}
</ul>
<br />
</div>
}
<script>
//<!--
<%$ include: ErrorPage.js %>
//-->
</script>
</body>
</html>

View File

@ -1,30 +0,0 @@
// 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;
using System.Collections.Generic;
namespace Microsoft.AspNetCore.Diagnostics.Views
{
/// <summary>
/// Contains details for individual exception messages.
/// </summary>
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class ErrorDetails
{
/// <summary>
/// An individual exception
/// </summary>
public Exception Error { get; set; }
/// <summary>
/// The generated stack frames
/// </summary>
public IEnumerable<StackFrame> StackFrames { get; set; }
/// <summary>
/// Gets or sets the summary message.
/// </summary>
public string ErrorMessage { get; set; }
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,262 +0,0 @@
@using System
@using System.Globalization
@using System.Linq
@using System.Net
@using System.Reflection
@using Microsoft.AspNetCore.Diagnostics.Views
@using Microsoft.AspNetCore.Diagnostics
@functions
{
public ErrorPage(ErrorPageModel model)
{
Model = model;
}
public ErrorPageModel Model { get; set; }
}
@{
// TODO: Response.ReasonPhrase = "Internal Server Error";
Response.ContentType = "text/html; charset=utf-8";
string location = string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentUICulture.TwoLetterISOLanguageName" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>@Resources.ErrorPageHtml_Title</title>
<style>
<%$ include: ErrorPage.css %>
</style>
</head>
<body>
<h1>@Resources.ErrorPageHtml_UnhandledException</h1>
@foreach (var errorDetail in Model.ErrorDetails)
{
<div class="titleerror">@errorDetail.Error.GetType().Name: @{ Output.Write(HtmlEncodeAndReplaceLineBreaks(errorDetail.Error.Message)); }</div>
@{
var firstFrame = errorDetail.StackFrames.FirstOrDefault();
if (firstFrame != null)
{
location = firstFrame.Function;
}
}
if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File))
{
<p class="location">@location in <code title="@firstFrame.File">@System.IO.Path.GetFileName(firstFrame.File)</code>, line @firstFrame.Line</p>
}
else if (!string.IsNullOrEmpty(location))
{
<p class="location">@location</p>
}
else
{
<p class="location">@Resources.ErrorPageHtml_UnknownLocation</p>
}
}
@{
var reflectionTypeLoadException = Model.ErrorDetails.Last()?.Error as ReflectionTypeLoadException;
if (reflectionTypeLoadException != null)
{
if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
{
<h3>Loader Exceptions:</h3>
<ul>
@foreach (var ex in reflectionTypeLoadException.LoaderExceptions)
{
<li>@ex.Message</li>
}
</ul>
}
}
}
<ul id="header">
<li id="stack" tabindex="1" class="selected">
@Resources.ErrorPageHtml_StackButton
</li>
<li id="query" tabindex="2">
@Resources.ErrorPageHtml_QueryButton
</li>
<li id="cookies" tabindex="3">
@Resources.ErrorPageHtml_CookiesButton
</li>
<li id="headers" tabindex="4">
@Resources.ErrorPageHtml_HeadersButton
</li>
</ul>
<div id="stackpage" class="page">
<ul>
@{
var exceptionCount = 0;
var stackFrameCount = 0;
var exceptionDetailId = "";
var frameId = "";
}
@foreach (var errorDetail in Model.ErrorDetails)
{
@{
exceptionCount++;
exceptionDetailId = "exceptionDetail" + exceptionCount;
}
<li>
<h2 class="stackerror">@errorDetail.Error.GetType().Name: @errorDetail.Error.Message</h2>
<ul>
@foreach (var frame in errorDetail.StackFrames)
{
@{
stackFrameCount++;
frameId = "frame" + stackFrameCount;
}
<li class="frame" id="@frameId">
@if (string.IsNullOrEmpty(frame.File))
{
<h3>@frame.Function</h3>
}
else
{
<h3>@frame.Function in <code title="@frame.File">@System.IO.Path.GetFileName(frame.File)</code></h3>
}
@if (frame.Line != 0 && frame.ContextCode.Any())
{
<button class="expandCollapseButton" data-frameId="@frameId">+</button>
<div class="source">
@if (frame.PreContextCode.Any())
{
<ol start="@frame.PreContextLine" class="collapsible">
@foreach (var line in frame.PreContextCode)
{
<li><span>@line</span></li>
}
</ol>
}
<ol start="@frame.Line" class="highlight">
@foreach (var line in frame.ContextCode)
{
<li><span>@line</span></li>
}
</ol>
@if (frame.PostContextCode.Any())
{
<ol start='@(frame.Line + 1)' class="collapsible">
@foreach (var line in frame.PostContextCode)
{
<li><span>@line</span></li>
}
</ol>
}
</div>
}
</li>
}
</ul>
</li>
<li>
<br/>
<div class="rawExceptionBlock">
<div class="showRawExceptionContainer">
<button class="showRawException" data-exceptionDetailId="@exceptionDetailId">Show raw exception details</button>
</div>
<div id="@exceptionDetailId" class="rawExceptionDetails">
<pre class="rawExceptionStackTrace">@errorDetail.Error.ToString()</pre>
</div>
</div>
</li>
}
</ul>
</div>
<div id="querypage" class="page">
@if (Model.Query.Any())
{
<table>
<thead>
<tr>
<th>@Resources.ErrorPageHtml_VariableColumn</th>
<th>@Resources.ErrorPageHtml_ValueColumn</th>
</tr>
</thead>
<tbody>
@foreach (var kv in Model.Query.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
{
<tr>
<td>@kv.Key</td>
<td>@v</td>
</tr>
}
}
</tbody>
</table>
}
else
{
<p>@Resources.ErrorPageHtml_NoQueryStringData</p>
}
</div>
<div id="cookiespage" class="page">
@if (Model.Cookies.Any())
{
<table>
<thead>
<tr>
<th>@Resources.ErrorPageHtml_VariableColumn</th>
<th>@Resources.ErrorPageHtml_ValueColumn</th>
</tr>
</thead>
<tbody>
@foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key))
{
<tr>
<td>@kv.Key</td>
<td>@kv.Value</td>
</tr>
}
</tbody>
</table>
}
else
{
<p>@Resources.ErrorPageHtml_NoCookieData</p>
}
</div>
<div id="headerspage" class="page">
@if (Model.Headers.Any())
{
<table>
<thead>
<tr>
<th>@Resources.ErrorPageHtml_VariableColumn</th>
<th>@Resources.ErrorPageHtml_ValueColumn</th>
</tr>
</thead>
<tbody>
@foreach (var kv in Model.Headers.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
{
<tr>
<td>@kv.Key</td>
<td>@v</td>
</tr>
}
}
</tbody>
</table>
}
else
{
<p>@Resources.ErrorPageHtml_NoHeaderData</p>
}
</div>
<script>
//<!--
<%$ include: ErrorPage.js %>
//-->
</script>
</body>
</html>

View File

@ -1,195 +0,0 @@
body {
font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;
font-size: .813em;
color: #222;
}
h1, h2, h3, h4, h5 {
/*font-family: 'Segoe UI',Tahoma,Arial,Helvetica,sans-serif;*/
font-weight: 100;
}
h1 {
color: #44525e;
margin: 15px 0 15px 0;
}
h2 {
margin: 10px 5px 0 0;
}
h3 {
color: #363636;
margin: 5px 5px 0 0;
}
code {
font-family: Consolas, "Courier New", courier, monospace;
}
body .titleerror {
padding: 3px 3px 6px 3px;
display: block;
font-size: 1.5em;
font-weight: 100;
}
body .location {
margin: 3px 0 10px 30px;
}
#header {
font-size: 18px;
padding: 15px 0;
border-top: 1px #ddd solid;
border-bottom: 1px #ddd solid;
margin-bottom: 0;
}
#header li {
display: inline;
margin: 5px;
padding: 5px;
color: #a0a0a0;
cursor: pointer;
}
#header .selected {
background: #44c5f2;
color: #fff;
}
#stackpage ul {
list-style: none;
padding-left: 0;
margin: 0;
/*border-bottom: 1px #ddd solid;*/
}
#stackpage .details {
font-size: 1.2em;
padding: 3px;
color: #000;
}
#stackpage .stackerror {
padding: 5px;
border-bottom: 1px #ddd solid;
}
#stackpage .frame {
padding: 0;
margin: 0 0 0 30px;
}
#stackpage .frame h3 {
padding: 2px;
margin: 0;
}
#stackpage .source {
padding: 0 0 0 30px;
}
#stackpage .source ol li {
font-family: Consolas, "Courier New", courier, monospace;
white-space: pre;
background-color: #fbfbfb;
}
#stackpage .frame .source .highlight li span {
color: #FF0000;
}
#stackpage .source ol.collapsible li {
color: #888;
}
#stackpage .source ol.collapsible li span {
color: #606060;
}
.page table {
border-collapse: separate;
border-spacing: 0;
margin: 0 0 20px;
}
.page th {
vertical-align: bottom;
padding: 10px 5px 5px 5px;
font-weight: 400;
color: #a0a0a0;
text-align: left;
}
.page td {
padding: 3px 10px;
}
.page th, .page td {
border-right: 1px #ddd solid;
border-bottom: 1px #ddd solid;
border-left: 1px transparent solid;
border-top: 1px transparent solid;
box-sizing: border-box;
}
.page th:last-child, .page td:last-child {
border-right: 1px transparent solid;
}
.page .length {
text-align: right;
}
a {
color: #1ba1e2;
text-decoration: none;
}
a:hover {
color: #13709e;
text-decoration: underline;
}
.showRawException {
cursor: pointer;
color: #44c5f2;
background-color: transparent;
font-size: 1.2em;
text-align: left;
text-decoration: none;
display: inline-block;
border: 0;
padding: 0;
}
.rawExceptionStackTrace {
font-size: 1.2em;
}
.rawExceptionBlock {
border-top: 1px #ddd solid;
border-bottom: 1px #ddd solid;
}
.showRawExceptionContainer {
margin-top: 10px;
margin-bottom: 10px;
}
.expandCollapseButton {
cursor: pointer;
float: left;
height: 16px;
width: 16px;
font-size: 10px;
position: absolute;
left: 10px;
background-color: #eee;
padding: 0;
border: 0;
margin: 0;
}

View File

@ -1,192 +0,0 @@
(function (window, undefined) {
"use strict";
function ns(selector, element) {
return new NodeCollection(selector, element);
}
function NodeCollection(selector, element) {
this.items = [];
element = element || window.document;
var nodeList;
if (typeof (selector) === "string") {
nodeList = element.querySelectorAll(selector);
for (var i = 0, l = nodeList.length; i < l; i++) {
this.items.push(nodeList.item(i));
}
}
}
NodeCollection.prototype = {
each: function (callback) {
for (var i = 0, l = this.items.length; i < l; i++) {
callback(this.items[i], i);
}
return this;
},
children: function (selector) {
var children = [];
this.each(function (el) {
children = children.concat(ns(selector, el).items);
});
return ns(children);
},
hide: function () {
this.each(function (el) {
el.style.display = "none";
});
return this;
},
toggle: function () {
this.each(function (el) {
el.style.display = el.style.display === "none" ? "" : "none";
});
return this;
},
show: function () {
this.each(function (el) {
el.style.display = "";
});
return this;
},
addClass: function (className) {
this.each(function (el) {
var existingClassName = el.className,
classNames;
if (!existingClassName) {
el.className = className;
} else {
classNames = existingClassName.split(" ");
if (classNames.indexOf(className) < 0) {
el.className = existingClassName + " " + className;
}
}
});
return this;
},
removeClass: function (className) {
this.each(function (el) {
var existingClassName = el.className,
classNames, index;
if (existingClassName === className) {
el.className = "";
} else if (existingClassName) {
classNames = existingClassName.split(" ");
index = classNames.indexOf(className);
if (index > 0) {
classNames.splice(index, 1);
el.className = classNames.join(" ");
}
}
});
return this;
},
attr: function (name) {
if (this.items.length === 0) {
return null;
}
return this.items[0].getAttribute(name);
},
on: function (eventName, handler) {
this.each(function (el, idx) {
var callback = function (e) {
e = e || window.event;
if (!e.which && e.keyCode) {
e.which = e.keyCode; // Normalize IE8 key events
}
handler.apply(el, [e]);
};
if (el.addEventListener) { // DOM Events
el.addEventListener(eventName, callback, false);
} else if (el.attachEvent) { // IE8 events
el.attachEvent("on" + eventName, callback);
} else {
el["on" + type] = callback;
}
});
return this;
},
click: function (handler) {
return this.on("click", handler);
},
keypress: function (handler) {
return this.on("keypress", handler);
}
};
function frame(el) {
ns(".source .collapsible", el).toggle();
}
function expandCollapseButton(el) {
var frameId = el.getAttribute("data-frameId");
frame(document.getElementById(frameId));
if (el.innerText === "+") {
el.innerText = "-";
}
else {
el.innerText = "+";
}
}
function tab(el) {
var unselected = ns("#header .selected").removeClass("selected").attr("id");
var selected = ns("#" + el.id).addClass("selected").attr("id");
ns("#" + unselected + "page").hide();
ns("#" + selected + "page").show();
}
ns(".rawExceptionDetails").hide();
ns(".collapsible").hide();
ns(".page").hide();
ns("#stackpage").show();
ns(".expandCollapseButton")
.click(function () {
expandCollapseButton(this);
})
.keypress(function (e) {
if (e.which === 13) {
expandCollapseButton(this);
}
});
ns("#header li")
.click(function () {
tab(this);
})
.keypress(function (e) {
if (e.which === 13) {
tab(this);
}
});
ns(".showRawException")
.click(function () {
var exceptionDetailId = this.getAttribute("data-exceptionDetailId");
ns("#" + exceptionDetailId).toggle();
});
})(window);

View File

@ -1,43 +0,0 @@
// 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;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Diagnostics.Views
{
/// <summary>
/// Holds data to be displayed on the error page.
/// </summary>
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class ErrorPageModel
{
/// <summary>
/// Options for what output to display.
/// </summary>
public DeveloperExceptionPageOptions Options { get; set; }
/// <summary>
/// Detailed information about each exception in the stack.
/// </summary>
public IEnumerable<ErrorDetails> ErrorDetails { get; set; }
/// <summary>
/// Parsed query data.
/// </summary>
public IQueryCollection Query { get; set; }
/// <summary>
/// Request cookies.
/// </summary>
public IRequestCookieCollection Cookies { get; set; }
/// <summary>
/// Request headers.
/// </summary>
public IDictionary<string, StringValues> Headers { get; set; }
}
}

View File

@ -1,57 +0,0 @@
// 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;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.AspNetCore.Diagnostics.Views
{
/// <summary>
/// Detailed exception stack information used to generate a view
/// </summary>
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class StackFrame
{
/// <summary>
/// Function containing instruction
/// </summary>
public string Function { get; set; }
/// <summary>
/// File containing the instruction
/// </summary>
public string File { get; set; }
/// <summary>
/// The line number of the instruction
/// </summary>
public int Line { get; set; }
/// <summary>
/// The line preceeding the frame line
/// </summary>
public int PreContextLine { get; set; }
/// <summary>
/// Lines of code before the actual error line(s).
/// </summary>
public IEnumerable<string> PreContextCode { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Line(s) of code responsible for the error.
/// </summary>
public IEnumerable<string> ContextCode { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Lines of code after the actual error line(s).
/// </summary>
public IEnumerable<string> PostContextCode { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Specific error details for this stack frame.
/// </summary>
public string ErrorDetails { get; set; }
}
}

View File

@ -1,56 +0,0 @@
// 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;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.AspNetCore.Diagnostics.Views
{
/// <summary>
/// Detailed exception stack information used to generate a view
/// </summary>
[Obsolete("This type is for internal use only and will be removed in a future version.")]
public class StackFrameInfo
{
/// <summary>
/// Function containing instruction
/// </summary>
public string Function { get; set; }
/// <summary>
/// File containing the instruction
/// </summary>
public string File { get; set; }
/// <summary>
/// The line number of the instruction
/// </summary>
public int Line { get; set; }
/// <summary>
/// The line preceeding the frame line
/// </summary>
public int PreContextLine { get; set; }
/// <summary>
/// Lines of code before the actual error line(s).
/// </summary>
public IEnumerable<string> PreContextCode { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Line(s) of code responsible for the error.
/// </summary>
public IEnumerable<string> ContextCode { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Lines of code after the actual error line(s).
/// </summary>
public IEnumerable<string> PostContextCode { get; set; } = Enumerable.Empty<string>();
/// <summary>
/// Specific error details for this stack frame.
/// </summary>
public string ErrorDetails { get; set; }
}
}

View File

@ -0,0 +1,30 @@
[
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.CompilationErrorPageModel",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.CompilationErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorDetails",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorPageModel",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.StackFrame",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.StackFrameInfo",
"Kind": "Removal"
}
]

View File

@ -0,0 +1,30 @@
[
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.CompilationErrorPageModel",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.CompilationErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorDetails",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.ErrorPageModel",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.StackFrame",
"Kind": "Removal"
},
{
"OldTypeId": "public class Microsoft.AspNetCore.Diagnostics.Views.StackFrameInfo",
"Kind": "Removal"
}
]