diff --git a/.gitignore b/.gitignore
index 8bc217058d..52351df12f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,4 +21,5 @@ nuget.exe
*DS_Store
*.ncrunchsolution
*.*sdf
-*.ipch
\ No newline at end of file
+*.ipch
+*.sln.ide
\ No newline at end of file
diff --git a/DiagnosticsPages.sln b/DiagnosticsPages.sln
index 3bb0a67b81..87fd04d83a 100644
--- a/DiagnosticsPages.sln
+++ b/DiagnosticsPages.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30327.0
+# Visual Studio 14
+VisualStudioVersion = 14.0.21628.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{509A6F36-AD80-4A18-B5B1-717D38DFF29D}"
EndProject
@@ -13,6 +13,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Diagnostic
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ErrorPageSample", "samples\ErrorPageSample\ErrorPageSample.kproj", "{589AC17F-9455-4764-8F82-FCD2AE58DA14}"
EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PageGenerator", "src\PageGenerator\PageGenerator.kproj", "{4D4A785A-ECB9-4916-A88F-0FD306EE3B74}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -51,6 +53,15 @@ Global
{589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|Mixed Platforms.Build.0 = Release|x86
{589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|x86.ActiveCfg = Release|x86
{589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|x86.Build.0 = Release|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Debug|x86.ActiveCfg = Debug|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Debug|x86.Build.0 = Debug|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|Any CPU.ActiveCfg = Release|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|Mixed Platforms.Build.0 = Release|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|x86.ActiveCfg = Release|x86
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -59,5 +70,6 @@ Global
{C5F59CBA-DF2D-4983-8CBB-11B6AF21B416} = {ACAA0157-A8C4-4152-93DE-90CCDF304087}
{68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D}
{589AC17F-9455-4764-8F82-FCD2AE58DA14} = {ACAA0157-A8C4-4152-93DE-90CCDF304087}
+ {4D4A785A-ECB9-4916-A88F-0FD306EE3B74} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D}
EndGlobalSection
EndGlobal
diff --git a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs
index 10f9fdecac..774b9d8bdf 100644
--- a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs
+++ b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs
@@ -60,7 +60,7 @@ namespace Microsoft.AspNet.Diagnostics
{
try
{
- DisplayException(context, ex);
+ await DisplayException(context, ex);
return;
}
catch (Exception)
@@ -72,7 +72,7 @@ namespace Microsoft.AspNet.Diagnostics
}
// Assumes the response headers have not been sent. If they have, still attempt to write to the body.
- private void DisplayException(HttpContext context, Exception ex)
+ private async Task DisplayException(HttpContext context, Exception ex)
{
var request = context.Request;
@@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Diagnostics
}*/
var errorPage = new ErrorPage() { Model = model };
- errorPage.Execute(context);
+ await errorPage.ExecuteAsync(context);
}
private IEnumerable GetErrorDetails(Exception ex, bool showSource)
diff --git a/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.kproj b/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.kproj
index 896a7111a0..6749d006c1 100644
--- a/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.kproj
+++ b/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.kproj
@@ -20,13 +20,10 @@
-
-
-
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/BaseView.cs b/src/Microsoft.AspNet.Diagnostics/Views/BaseView.cs
index bfcd2c93ee..934bf7096b 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/BaseView.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/BaseView.cs
@@ -5,6 +5,7 @@ using System;
using System.Globalization;
using System.IO;
using System.Net;
+using System.Threading.Tasks;
namespace Microsoft.AspNet.Diagnostics.Views
{
@@ -37,20 +38,20 @@ namespace Microsoft.AspNet.Diagnostics.Views
/// Execute an individual request
///
///
- public void Execute(HttpContext context)
+ public async Task ExecuteAsync(HttpContext context)
{
Context = context;
Request = Context.Request;
Response = Context.Response;
Output = new StreamWriter(Response.Body);
- Execute();
+ await ExecuteAsync();
Output.Dispose();
}
///
/// Execute an individual request
///
- public abstract void Execute();
+ public abstract Task ExecuteAsync();
///
/// Write the given value directly to the output
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs
index cd293e7b86..86971816a6 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.cs
@@ -1,38 +1,29 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18213
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
+namespace Microsoft.AspNet.Diagnostics.Views
+{
+#line 1 "DiagnosticsPage.cshtml"
+using System
-namespace Microsoft.AspNet.Diagnostics.Views {
-
- #line 1 "DiagnosticsPage.cshtml"
- using System;
-
- #line default
- #line hidden
-
- #line 2 "DiagnosticsPage.cshtml"
- using System.Globalization;
-
- #line default
- #line hidden
-
-
- public class DiagnosticsPage : Microsoft.AspNet.Diagnostics.Views.BaseView {
-
+#line default
#line hidden
-
- public DiagnosticsPage() {
+ ;
+#line 2 "DiagnosticsPage.cshtml"
+using System.Globalization
+
+#line default
+#line hidden
+ ;
+ using System.Threading.Tasks;
+
+ public class DiagnosticsPage : Microsoft.AspNet.Diagnostics.Views.BaseView
+ {
+ #line hidden
+ public DiagnosticsPage()
+ {
}
-
- public override void Execute() {
-
- #line 3 "DiagnosticsPage.cshtml"
+
+ public override async Task ExecuteAsync()
+ {
+#line 3 "DiagnosticsPage.cshtml"
Response.ContentType = "text/html";
string error = Request.Query.Get("error");
@@ -41,93 +32,70 @@ namespace Microsoft.AspNet.Diagnostics.Views {
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "User requested error '{0}'", error));
}
-
- #line default
- #line hidden
-WriteLiteral("\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n ");
+ Write(
+#line 16 "DiagnosticsPage.cshtml"
+ Resources.DiagnosticsPageHtml_Title
-WriteLiteral(" xmlns=\"http://www.w3.org/1999/xhtml\"");
+#line default
+#line hidden
+ );
-WriteLiteral(">\r\n\r\n \r\n\r\n\r\n \r\n
");
+ Write(
+#line 20 "DiagnosticsPage.cshtml"
+ Resources.DiagnosticsPageHtml_Title
-WriteLiteral(" charset=\"utf-8\"");
+#line default
+#line hidden
+ );
-WriteLiteral(" />\r\n ");
+ WriteLiteral("
\r\n
");
+ Write(
+#line 21 "DiagnosticsPage.cshtml"
+ Resources.DiagnosticsPageHtml_Information
-
- #line 16 "DiagnosticsPage.cshtml"
- Write(Resources.DiagnosticsPageHtml_Title);
+#line default
+#line hidden
+ );
-
- #line default
- #line hidden
-WriteLiteral("\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
");
-
-
- #line 24 "DiagnosticsPage.cshtml"
- Write(Resources.DiagnosticsPageHtml_TestErrorSection);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n
(Request.PathBase
-
- #line default
- #line hidden
-, 774), false)
-
- #line 25 "DiagnosticsPage.cshtml"
-, Tuple.Create(Tuple.Create("", 791), Tuple.Create(Request.Path
-
- #line default
- #line hidden
-, 791), false)
-, Tuple.Create(Tuple.Create("", 804), Tuple.Create("?error=", 804), true)
-
- #line 25 "DiagnosticsPage.cshtml"
-, Tuple.Create(Tuple.Create("", 811), Tuple.Create(Resources.DiagnosticsPageHtml_TestErrorMessage
-
- #line default
- #line hidden
-, 811), false)
-);
-
-WriteLiteral(">throw InvalidOperationException
\r\n
\r\n\r\n\r\n");
+#line default
+#line hidden
+ , 791), false), Tuple.Create(Tuple.Create("", 804), Tuple.Create("?error=", 804), true),
+ Tuple.Create(Tuple.Create("", 811), Tuple.Create
(
+#line 25 "DiagnosticsPage.cshtml"
+ Resources.DiagnosticsPageHtml_TestErrorMessage
+#line default
+#line hidden
+ , 811), false));
+ WriteLiteral(">throw InvalidOperationException\r\n \r\n\r\n\r\n");
}
}
}
-
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.tt b/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.tt
deleted file mode 100644
index 643ca3bb50..0000000000
--- a/src/Microsoft.AspNet.Diagnostics/Views/DiagnosticsPage.tt
+++ /dev/null
@@ -1,26 +0,0 @@
-<#@ template debug="false" hostspecific="true" language="C#" #>
-<#@ assembly name="System.Core" #>
-<#@ assembly name="System.Web.Razor" #>
-<#@ import namespace="System.Linq" #>
-<#@ import namespace="System.Text" #>
-<#@ import namespace="System.Collections.Generic" #>
-<#@ import namespace="System.Web.Razor" #>
-<#@ import namespace="System.Web.Razor.Text" #>
-<#@ output extension=".cs" #>
-<#
-var host = new RazorEngineHost(new CSharpRazorCodeLanguage());
-host.DefaultBaseClass = "Microsoft.Owin.Diagnostics.Views.BaseView";
-var engine = new RazorTemplateEngine(host);
-var path = Host.ResolvePath("DiagnosticsPage.cshtml");
-
-var code = engine.GenerateCode(
- new System.IO.StreamReader(path),
- "DiagnosticsPage",
- "Microsoft.Owin.Diagnostics.Views",
- @"DiagnosticsPage.cshtml");
-
-var provider = new Microsoft.CSharp.CSharpCodeProvider();
-var writer = new System.IO.StringWriter();
-provider.GenerateCodeFromCompileUnit(code.GeneratedCode, writer, null);
-#>
-<#=writer.ToString()#>
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
index ed73f65b6c..022dcc616b 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
@@ -1,1649 +1,1026 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.33440
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
+namespace Microsoft.AspNet.Diagnostics.Views
+{
+#line 1 "ErrorPage.cshtml"
+using System
-namespace Microsoft.AspNet.Diagnostics.Views {
-
- #line 1 "ErrorPage.cshtml"
- using System;
-
- #line default
- #line hidden
-
- #line 2 "ErrorPage.cshtml"
- using System.Globalization;
-
- #line default
- #line hidden
-
- #line 3 "ErrorPage.cshtml"
- using System.Linq;
-
- #line default
- #line hidden
-
- #line 4 "ErrorPage.cshtml"
- using Views;
-
- #line default
- #line hidden
-
-
- public class ErrorPage : Microsoft.AspNet.Diagnostics.Views.BaseView {
-
+#line default
#line hidden
-
- #line 6 "ErrorPage.cshtml"
-
+ ;
+#line 2 "ErrorPage.cshtml"
+using System.Globalization
+
+#line default
+#line hidden
+ ;
+#line 3 "ErrorPage.cshtml"
+using System.Linq
+
+#line default
+#line hidden
+ ;
+#line 4 "ErrorPage.cshtml"
+using Views
+
+#line default
+#line hidden
+ ;
+ using System.Threading.Tasks;
+
+ public class ErrorPage : Microsoft.AspNet.Diagnostics.Views.BaseView
+ {
+#line 6 "ErrorPage.cshtml"
+
///
///
///
- public Views.ErrorPageModel Model { get; set; }
+ public ErrorPageModel Model { get; set; }
- #line default
+#line default
+#line hidden
#line hidden
-
-
- public ErrorPage() {
+ public ErrorPage()
+ {
}
-
- public override void Execute() {
-
- #line 12 "ErrorPage.cshtml"
+
+ public override async Task ExecuteAsync()
+ {
+#line 12 "ErrorPage.cshtml"
Response.StatusCode = 500;
- // Response.ReasonPhrase = "Internal Server Error";
+ // TODO: Response.ReasonPhrase = "Internal Server Error";
Response.ContentType = "text/html";
Response.ContentLength = null; // Clear any prior Content-Length
string location = string.Empty;
-
- #line default
- #line hidden
-WriteLiteral("\r\n\r\n(System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName
-
- #line default
- #line hidden
-, 468), false)
-);
+ WriteLiteral("\r\n\r\n(
+#line 20 "ErrorPage.cshtml"
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName
-WriteLiteral(" xmlns=\"http://www.w3.org/1999/xhtml\"");
+#line default
+#line hidden
+ , 471), false));
+ WriteLiteral(" xmlns=\"http://www.w3.org/1999/xhtml\">\r\n \r\n \r\n ");
+ Write(
+#line 23 "ErrorPage.cshtml"
+ Resources.ErrorPageHtml_Title
-WriteLiteral(">\r\n \r\n \r\n \r\n \r\n \r\n ");
-
-
- #line 29 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_UnhandledException);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
-
-
- #line 30 "ErrorPage.cshtml"
+ WriteLiteral("\r\n");
+#line 31 "ErrorPage.cshtml"
-
- #line default
- #line hidden
-
- #line 30 "ErrorPage.cshtml"
+
+#line default
+#line hidden
+
+#line 31 "ErrorPage.cshtml"
if (Model.Options.ShowExceptionDetails)
{
foreach (var errorDetail in Model.ErrorDetails)
{
-
- #line default
- #line hidden
-WriteLiteral(" ");
+ Write(
+#line 35 "ErrorPage.cshtml"
+ errorDetail.Error.GetType().Name
-WriteLiteral(">");
+#line default
+#line hidden
+ );
-
- #line 34 "ErrorPage.cshtml"
- Write(errorDetail.Error.GetType().Name);
+ WriteLiteral(": ");
+ Write(
+#line 35 "ErrorPage.cshtml"
+ errorDetail.Error.Message
-
- #line default
- #line hidden
-WriteLiteral(": ");
+#line default
+#line hidden
+ );
-
- #line 34 "ErrorPage.cshtml"
- Write(errorDetail.Error.Message);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
-
-
- #line 35 "ErrorPage.cshtml"
+ WriteLiteral("\r\n");
+#line 36 "ErrorPage.cshtml"
-
- #line default
- #line hidden
-
- #line 35 "ErrorPage.cshtml"
+
+#line default
+#line hidden
+
+#line 36 "ErrorPage.cshtml"
StackFrame firstFrame = null;
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 47 "ErrorPage.cshtml"
-
- #line default
- #line hidden
-
- #line 46 "ErrorPage.cshtml"
-
if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File))
{
-
- #line default
- #line hidden
-WriteLiteral(" ");
+ Write(
+#line 50 "ErrorPage.cshtml"
+ location
-WriteLiteral(">");
+#line default
+#line hidden
+ );
-
- #line 49 "ErrorPage.cshtml"
- Write(location);
+ WriteLiteral(" in (
+#line 50 "ErrorPage.cshtml"
+ firstFrame.File
-
- #line default
- #line hidden
-WriteLiteral(" in ");
+ Write(
+#line 50 "ErrorPage.cshtml"
+ System.IO.Path.GetFileName(firstFrame.File)
-WriteAttribute("title", Tuple.Create(" title=\"", 1899), Tuple.Create("\"", 1923)
-
- #line 49 "ErrorPage.cshtml"
-, Tuple.Create(Tuple.Create("", 1907), Tuple.Create(firstFrame.File
-
- #line default
- #line hidden
-, 1907), false)
-);
+#line default
+#line hidden
+ );
-WriteLiteral(">");
+ WriteLiteral(", line ");
+ Write(
+#line 50 "ErrorPage.cshtml"
+ firstFrame.Line
-
- #line 49 "ErrorPage.cshtml"
- Write(System.IO.Path.GetFileName(firstFrame.File));
+#line default
+#line hidden
+ );
-
- #line default
- #line hidden
-WriteLiteral(", line ");
-
-
- #line 49 "ErrorPage.cshtml"
- Write(firstFrame.Line);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
-
-
- #line 50 "ErrorPage.cshtml"
+ WriteLiteral("
\r\n");
+#line 51 "ErrorPage.cshtml"
}
else if (!string.IsNullOrEmpty(location))
{
-
- #line default
- #line hidden
-WriteLiteral(" ");
+ Write(
+#line 54 "ErrorPage.cshtml"
+ location
-WriteLiteral(">");
+#line default
+#line hidden
+ );
-
- #line 53 "ErrorPage.cshtml"
- Write(location);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
-
-
- #line 54 "ErrorPage.cshtml"
+ WriteLiteral("\r\n");
+#line 55 "ErrorPage.cshtml"
}
else
{
-
- #line default
- #line hidden
-WriteLiteral(" ");
+ Write(
+#line 58 "ErrorPage.cshtml"
+ Resources.ErrorPageHtml_UnknownLocation
-WriteLiteral(">");
+#line default
+#line hidden
+ );
-
- #line 57 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_UnknownLocation);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
-
-
- #line 58 "ErrorPage.cshtml"
+ WriteLiteral("\r\n");
+#line 59 "ErrorPage.cshtml"
}
}
}
else
{
-
- #line default
- #line hidden
-WriteLiteral(" ");
+#line default
+#line hidden
-
- #line 63 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_EnableShowExceptions);
+ WriteLiteral(" ");
+ Write(
+#line 64 "ErrorPage.cshtml"
+ Resources.ErrorPageHtml_EnableShowExceptions
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
+#line default
+#line hidden
+ );
-
- #line 64 "ErrorPage.cshtml"
+ WriteLiteral("
\r\n");
+#line 65 "ErrorPage.cshtml"
}
-
- #line default
- #line hidden
-WriteLiteral(" \r\n");
+#line default
+#line hidden
-
- #line 97 "ErrorPage.cshtml"
+ WriteLiteral(" \r\n");
+#line 98 "ErrorPage.cshtml"
-
- #line default
- #line hidden
-
- #line 97 "ErrorPage.cshtml"
+
+#line default
+#line hidden
+
+#line 98 "ErrorPage.cshtml"
if (Model.Options.ShowExceptionDetails)
{
-
- #line default
- #line hidden
-WriteLiteral(" \r\n");
+#line 155 "ErrorPage.cshtml"
}
-
- #line default
- #line hidden
-WriteLiteral(" ");
+#line default
+#line hidden
-
- #line 155 "ErrorPage.cshtml"
+ WriteLiteral(" ");
+#line 156 "ErrorPage.cshtml"
if (Model.Options.ShowQuery)
{
-
- #line default
- #line hidden
-WriteLiteral(" \r\n");
-
-
- #line 158 "ErrorPage.cshtml"
+ WriteLiteral("
\r\n");
+#line 159 "ErrorPage.cshtml"
-
- #line default
- #line hidden
-
- #line 158 "ErrorPage.cshtml"
+
+#line default
+#line hidden
+
+#line 159 "ErrorPage.cshtml"
if (Model.Query.Any())
{
-
- #line default
- #line hidden
-WriteLiteral("
\r\n \r\n " +
+#line default
+#line hidden
+
+ WriteLiteral(" \r\n \r\n " +
" \r\n | ");
+ Write(
+#line 164 "ErrorPage.cshtml"
+ Resources.ErrorPageHtml_VariableColumn
-
- #line 163 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_VariableColumn);
+#line default
+#line hidden
+ );
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n ");
+ WriteLiteral(" | \r\n ");
+ Write(
+#line 165 "ErrorPage.cshtml"
+ Resources.ErrorPageHtml_ValueColumn
-
- #line 164 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_ValueColumn);
+#line default
+#line hidden
+ );
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n
\r\n \r\n " +
+ WriteLiteral("\r\n \r\n \r\n " +
" \r\n");
-
-
- #line 168 "ErrorPage.cshtml"
+#line 169 "ErrorPage.cshtml"
-
- #line default
- #line hidden
-
- #line 168 "ErrorPage.cshtml"
+
+#line default
+#line hidden
+
+#line 169 "ErrorPage.cshtml"
foreach (var kv in Model.Query.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
{
-
- #line default
- #line hidden
-WriteLiteral(" \r\n " +
+#line default
+#line hidden
+
+ WriteLiteral("
\r\n " +
" | ");
+ Write(
+#line 174 "ErrorPage.cshtml"
+ kv.Key
-
- #line 173 "ErrorPage.cshtml"
- Write(kv.Key);
+#line default
+#line hidden
+ );
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n ");
+ WriteLiteral(" | \r\n ");
+ Write(
+#line 175 "ErrorPage.cshtml"
+ v
-
- #line 174 "ErrorPage.cshtml"
- Write(v);
+#line default
+#line hidden
+ );
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n
\r\n");
-
-
- #line 176 "ErrorPage.cshtml"
+ WriteLiteral("\r\n \r\n");
+#line 177 "ErrorPage.cshtml"
}
}
-
- #line default
- #line hidden
-WriteLiteral(" \r\n
\r\n");
+#line default
+#line hidden
-
- #line 180 "ErrorPage.cshtml"
+ WriteLiteral(" \r\n
\r\n");
+#line 181 "ErrorPage.cshtml"
}
else
{
-
- #line default
- #line hidden
-WriteLiteral("
");
+#line default
+#line hidden
-
- #line 183 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_NoQueryStringData);
+ WriteLiteral("
");
+ Write(
+#line 184 "ErrorPage.cshtml"
+ Resources.ErrorPageHtml_NoQueryStringData
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
+#line default
+#line hidden
+ );
-
- #line 184 "ErrorPage.cshtml"
+ WriteLiteral("\r\n");
+#line 185 "ErrorPage.cshtml"
}
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
+#line default
+#line hidden
-
- #line 186 "ErrorPage.cshtml"
+ WriteLiteral("
\r\n");
+#line 187 "ErrorPage.cshtml"
}
-
- #line default
- #line hidden
-WriteLiteral(" ");
+#line default
+#line hidden
-
- #line 187 "ErrorPage.cshtml"
+ WriteLiteral(" ");
+#line 188 "ErrorPage.cshtml"
if (Model.Options.ShowCookies)
{
- /*
-
- #line default
- #line hidden
-WriteLiteral(" \r\n");
-
-
- #line 190 "ErrorPage.cshtml"
-
-
- #line default
- #line hidden
-
- #line 190 "ErrorPage.cshtml"
- if (Model.Cookies.Any())
+ /* TODO:
+
+ @if (Model.Cookies.Any())
{
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n \r\n " +
-" \r\n | ");
-
-
- #line 195 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_VariableColumn);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n ");
-
-
- #line 196 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_ValueColumn);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n
\r\n \r\n " +
-" \r\n");
-
-
- #line 200 "ErrorPage.cshtml"
-
-
- #line default
- #line hidden
-
- #line 200 "ErrorPage.cshtml"
- foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key))
+
+
+
+ | @Resources.ErrorPageHtml_VariableColumn |
+ @Resources.ErrorPageHtml_ValueColumn |
+
+
+
+ @foreach (var kv in Model.Cookies.OrderBy(kv => kv.Key))
{
-
-
- #line default
- #line hidden
-WriteLiteral(" \r\n | ");
-
-
- #line 203 "ErrorPage.cshtml"
- Write(kv.Key);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n ");
-
-
- #line 204 "ErrorPage.cshtml"
- Write(kv.Value);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n
\r\n");
-
-
- #line 206 "ErrorPage.cshtml"
+
+ | @kv.Key |
+ @kv.Value |
+
}
-
-
- #line default
- #line hidden
-WriteLiteral(" \r\n
\r\n");
-
-
- #line 209 "ErrorPage.cshtml"
+
+
}
else
{
-
-
- #line default
- #line hidden
-WriteLiteral("
");
-
-
- #line 212 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_NoCookieData);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
-
-
- #line 213 "ErrorPage.cshtml"
+
@Resources.ErrorPageHtml_NoCookieData
}
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n");
+
*/
-
- #line 215 "ErrorPage.cshtml"
}
-
- #line default
- #line hidden
-WriteLiteral(" ");
+#line default
+#line hidden
-
- #line 216 "ErrorPage.cshtml"
+ WriteLiteral(" ");
+#line 219 "ErrorPage.cshtml"
if (Model.Options.ShowHeaders)
{
-
- #line default
- #line hidden
-WriteLiteral(" \r\n");
+#line 250 "ErrorPage.cshtml"
}
-
- #line default
- #line hidden
-WriteLiteral(" ");
+#line default
+#line hidden
-
- #line 248 "ErrorPage.cshtml"
+ WriteLiteral(" ");
+#line 251 "ErrorPage.cshtml"
if (Model.Options.ShowEnvironment)
{
- /*
-
- #line default
- #line hidden
-WriteLiteral(" \r\n
\r\n \r\n " +
-"\r\n | ");
-
-
- #line 254 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_VariableColumn);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n ");
-
-
- #line 255 "ErrorPage.cshtml"
- Write(Resources.ErrorPageHtml_ValueColumn);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n
\r\n \r\n " +
-" \r\n");
-
-
- #line 259 "ErrorPage.cshtml"
-
-
- #line default
- #line hidden
-
- #line 259 "ErrorPage.cshtml"
- foreach (var kv in Model.Environment.OrderBy(kv => kv.Key))
+ /* TODO:
+
+
+
+
+ | @Resources.ErrorPageHtml_VariableColumn |
+ @Resources.ErrorPageHtml_ValueColumn |
+
+
+
+ @foreach (var kv in Model.Environment.OrderBy(kv => kv.Key))
{
-
-
- #line default
- #line hidden
-WriteLiteral(" \r\n | ");
-
-
- #line 262 "ErrorPage.cshtml"
- Write(kv.Key);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n ");
-
-
- #line 263 "ErrorPage.cshtml"
- Write(kv.Value);
-
-
- #line default
- #line hidden
-WriteLiteral(" | \r\n
\r\n");
-
-
- #line 265 "ErrorPage.cshtml"
+
+ | @kv.Key |
+ @kv.Value |
+
}
-
-
- #line default
- #line hidden
-WriteLiteral(" \r\n
\r\n
\r\n");
-
- */
- #line 269 "ErrorPage.cshtml"
+
+
+
+ */
}
-
- #line default
- #line hidden
-WriteLiteral(" \r\n \r\n \r\n\r\n");
+#line default
+#line hidden
+ WriteLiteral(" \r\n \r\n\r\n");
}
}
}
-
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
index d280bf966e..ff275222dd 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
@@ -7,7 +7,7 @@
///
///
///
- public Views.ErrorPageModel Model { get; set; }
+ public ErrorPageModel Model { get; set; }
}
@{
Response.StatusCode = 500;
@@ -17,22 +17,23 @@
string location = string.Empty;
}
-
+
@Resources.ErrorPageHtml_Title
+ Hello
@Resources.ErrorPageHtml_UnhandledException
@if (Model.Options.ShowExceptionDetails)
{
foreach (var errorDetail in Model.ErrorDetails)
{
@errorDetail.Error.GetType().Name: @errorDetail.Error.Message
- {
+ @{
StackFrame firstFrame = null;
firstFrame = errorDetail.StackFrames.FirstOrDefault();
if (firstFrame != null)
@@ -43,7 +44,7 @@
{
location = errorDetail.Error.TargetSite.DeclaringType.FullName + "." + errorDetail.Error.TargetSite.Name;
}*/
- }
+ }
if (!string.IsNullOrEmpty(location) && firstFrame != null && !string.IsNullOrEmpty(firstFrame.File))
{
@location in @System.IO.Path.GetFileName(firstFrame.File), line @firstFrame.Line
@@ -272,10 +273,10 @@
*/
}
-
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.js b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.js
index f00df0918c..59cc4a5b3a 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.js
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.js
@@ -1,5 +1,4 @@
-
-(function ($) {
+(function (window, undefined) {
$('.collapsable').hide();
$('.page').hide();
$('#stackpage').show();
@@ -33,4 +32,4 @@
}
});
-})(jQuery);
+})(window);
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.tt b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.tt
deleted file mode 100644
index ca629b1435..0000000000
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.tt
+++ /dev/null
@@ -1,51 +0,0 @@
-<#@ template debug="false" hostspecific="true" language="C#" #>
-<#@ assembly name="System.Core" #>
-<#@ assembly name="System.Web.Razor" #>
-<#@ import namespace="System.Linq" #>
-<#@ import namespace="System.Text" #>
-<#@ import namespace="System.Globalization" #>
-<#@ import namespace="System.IO" #>
-<#@ import namespace="System.Collections.Generic" #>
-<#@ import namespace="System.Web.Razor" #>
-<#@ import namespace="System.Web.Razor.Text" #>
-<#@ output extension=".cs" #>
-<#
-var host = new RazorEngineHost(new CSharpRazorCodeLanguage());
-host.DefaultBaseClass = "Microsoft.Owin.Diagnostics.Views.BaseView";
-var engine = new RazorTemplateEngine(host);
-var path = Host.ResolvePath("ErrorPage.cshtml");
-
-var code = engine.GenerateCode(
- new System.IO.StreamReader(path),
- "ErrorPage",
- "Microsoft.Owin.Diagnostics.Views",
- @"ErrorPage.cshtml");
-
-var provider = new Microsoft.CSharp.CSharpCodeProvider();
-var writer = new System.IO.StringWriter();
-provider.GenerateCodeFromCompileUnit(code.GeneratedCode, writer, null);
-var source = writer.ToString();
-var startIndex = 0;
-while(startIndex < source.Length)
-{
- var startMatch = @"Write(@""[[";
- var startCode = @"WriteLiteral(@""";
- var endMatch = @"]]"");";
- var endCode = @""");";
- startIndex = source.IndexOf(startMatch, startIndex);
- if (startIndex == -1)
- {
- break;
- }
- var endIndex = source.IndexOf(endMatch, startIndex);
- if (endIndex == -1)
- {
- break;
- }
- var fileName = source.Substring(startIndex + startMatch.Length, endIndex - (startIndex + startMatch.Length));
- var replacement = File.ReadAllText(Host.ResolvePath(fileName)).Replace("\"", "\"\"");
- source = source.Substring(0, startIndex) + startCode + replacement + endCode + source.Substring(endIndex + endMatch.Length);
- startIndex = startIndex + startCode.Length + replacement.Length + endCode.Length;
- }
-#>
-<#=source#>
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.cs b/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.cs
index 5c22877b46..52aff9201c 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.cs
@@ -1,3953 +1,3806 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.34006
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
+namespace Microsoft.AspNet.Diagnostics.Views
+{
+#line 1 "WelcomePage.cshtml"
+using System
-namespace Microsoft.AspNet.Diagnostics.Views {
-
- #line 1 "WelcomePage.cshtml"
- using System;
-
- #line default
- #line hidden
-
-
- public class WelcomePage : Microsoft.AspNet.Diagnostics.Views.BaseView {
-
+#line default
#line hidden
-
- public WelcomePage() {
+ ;
+ using System.Threading.Tasks;
+
+ public class WelcomePage : Microsoft.AspNet.Diagnostics.Views.BaseView
+ {
+ #line hidden
+ public WelcomePage()
+ {
}
-
- public override void Execute() {
-
- #line 2 "WelcomePage.cshtml"
+
+ public override async Task ExecuteAsync()
+ {
+#line 2 "WelcomePage.cshtml"
Response.ContentType = "text/html";
-
- #line default
- #line hidden
-WriteLiteral("\r\n\r\n(System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName
-
- #line default
- #line hidden
-, 92), false)
-);
-
-WriteLiteral(">\r\n\r\n \r\n ");
-
-
- #line 9 "WelcomePage.cshtml"
- Write(Resources.WelcomeTitle);
-
-
- #line default
- #line hidden
-WriteLiteral("\r\n \r\n \r\n\r\n\r\n \r\n
\r\n
\r\n

(Resources.WelcomePageImageText_LightBulb
-
- #line default
- #line hidden
-, 250499), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 250541), Tuple.Create("\"", 250590)
-
- #line 291 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 250549), Tuple.Create
(Resources.WelcomePageImageText_LightBulb
-
- #line default
- #line hidden
-, 250549), false)
-);
-
-WriteLiteral(" width=\"274\"");
-
-WriteLiteral(" height=\"274\"");
-
-WriteLiteral(" />\r\n
\r\n

(Resources.WelcomePageImageText_Browser
-
- #line default
- #line hidden
-, 253697), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 253737), Tuple.Create("\"", 253784)
-
- #line 294 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 253745), Tuple.Create
(Resources.WelcomePageImageText_Browser
-
- #line default
- #line hidden
-, 253745), false)
-);
-
-WriteLiteral(" width=\"384\"");
-
-WriteLiteral(" height=\"305\"");
-
-WriteLiteral(" />:-|
\r\n \r\n
\r\n

(Resources.WelcomePageImageText_LightBulb
-
- #line default
- #line hidden
-, 260233), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 260275), Tuple.Create("\"", 260324)
-
- #line 298 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 260283), Tuple.Create
(Resources.WelcomePageImageText_LightBulb
-
- #line default
- #line hidden
-, 260283), false)
-);
-
-WriteLiteral(" width=\"274\"");
-
-WriteLiteral(" height=\"274\"");
-
-WriteLiteral(" />\r\n
\r\n

(Resources.WelcomePageImageText_LightBulb
-
- #line default
- #line hidden
-, 269125), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 269167), Tuple.Create("\"", 269216)
-
- #line 301 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 269175), Tuple.Create
(Resources.WelcomePageImageText_LightBulb
-
- #line default
- #line hidden
-, 269175), false)
-);
-
-WriteLiteral(" width=\"346\"");
-
-WriteLiteral(" height=\"658\"");
-
-WriteLiteral(" />\r\n
\r\n

(Resources.WelcomePageImageText_Skyline
-
- #line default
- #line hidden
-, 284091), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 284131), Tuple.Create("\"", 284178)
-
- #line 304 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 284139), Tuple.Create
(Resources.WelcomePageImageText_Skyline
-
- #line default
- #line hidden
-, 284139), false)
-);
-
-WriteLiteral(" width=\"1212\"");
-
-WriteLiteral(" height=\"202\"");
-
-WriteLiteral(" />\r\n
\r\n
\r\n\r\n \r\n
");
-
-
- #line 309 "WelcomePage.cshtml"
- Write(Resources.WelcomeHeader);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n
");
-
-
- #line 310 "WelcomePage.cshtml"
- Write(Resources.WelcomeStarted);
-
-
- #line default
- #line hidden
-WriteLiteral("
\r\n
");
-
-
- #line 311 "WelcomePage.cshtml"
- Write(Resources.WelcomeLearnOwin);
-
-
- #line default
- #line hidden
-WriteLiteral("\r\n \r\n

(Resources.WelcomePageImageText_LearnMore
-
- #line default
- #line hidden
-, 287037), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 287079), Tuple.Create("\"", 287128)
-
- #line 314 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 287087), Tuple.Create
(Resources.WelcomePageImageText_LearnMore
-
- #line default
- #line hidden
-, 287087), false)
-);
-
-WriteLiteral(" width=\"58\"");
-
-WriteLiteral(" height=\"29\"");
-
-WriteLiteral(" /> \r\n \r\n
");
-
-
- #line 316 "WelcomePage.cshtml"
- Write(Resources.WelcomeLearnMicrosoftOwin);
-
-
- #line default
- #line hidden
-WriteLiteral("\r\n

(Resources.WelcomePageImageText_LearnMore
-
- #line default
- #line hidden
-, 289803), false)
-);
-
-WriteAttribute("title", Tuple.Create(" title=\"", 289845), Tuple.Create("\"", 289894)
-
- #line 318 "WelcomePage.cshtml"
-, Tuple.Create(Tuple.Create("", 289853), Tuple.Create
(Resources.WelcomePageImageText_LearnMore
-
- #line default
- #line hidden
-, 289853), false)
-);
-
-WriteLiteral(" width=\"58\"");
-
-WriteLiteral(" height=\"29\"");
-
-WriteLiteral(" /> \r\n \r\n
\r\n\r\n\r\n\r\n");
-
+#line default
+#line hidden
+
+ WriteLiteral("\r\n\r\n(
+#line 6 "WelcomePage.cshtml"
+ System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName
+
+#line default
+#line hidden
+ , 92), false));
+ WriteLiteral(">\r\n\r\n \r\n ");
+ Write(
+#line 9 "WelcomePage.cshtml"
+ Resources.WelcomeTitle
+
+#line default
+#line hidden
+ );
+
+ WriteLiteral("\r\n \r\n " +
+" \r\n\r\n\r\n \r\n
\r\n
\r\n

(
+#line 291 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LightBulb
+
+#line default
+#line hidden
+ , 250499), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 250541), Tuple.Create("\"", 250590),
+ Tuple.Create(Tuple.Create("", 250549), Tuple.Create
(
+#line 291 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LightBulb
+
+#line default
+#line hidden
+ , 250549), false));
+ WriteLiteral(" width=\"274\" height=\"274\" />\r\n
\r\n

(
+#line 294 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_Browser
+
+#line default
+#line hidden
+ , 253697), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 253737), Tuple.Create("\"", 253784),
+ Tuple.Create(Tuple.Create("", 253745), Tuple.Create
(
+#line 294 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_Browser
+
+#line default
+#line hidden
+ , 253745), false));
+ WriteLiteral(" width=\"384\" height=\"305\" />:-|
\r\n \r\n
\r\n

(
+#line 298 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LightBulb
+
+#line default
+#line hidden
+ , 260233), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 260275), Tuple.Create("\"", 260324),
+ Tuple.Create(Tuple.Create("", 260283), Tuple.Create
(
+#line 298 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LightBulb
+
+#line default
+#line hidden
+ , 260283), false));
+ WriteLiteral(" width=\"274\" height=\"274\" />\r\n
\r\n " +
+"

(
+#line 301 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LightBulb
+
+#line default
+#line hidden
+ , 269125), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 269167), Tuple.Create("\"", 269216),
+ Tuple.Create(Tuple.Create("", 269175), Tuple.Create
(
+#line 301 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LightBulb
+
+#line default
+#line hidden
+ , 269175), false));
+ WriteLiteral(" width=\"346\" height=\"658\" />\r\n
\r\n " +
+"

(
+#line 304 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_Skyline
+
+#line default
+#line hidden
+ , 284091), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 284131), Tuple.Create("\"", 284178),
+ Tuple.Create(Tuple.Create("", 284139), Tuple.Create
(
+#line 304 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_Skyline
+
+#line default
+#line hidden
+ , 284139), false));
+ WriteLiteral(" width=\"1212\" height=\"202\" />\r\n
\r\n
\r\n\r\n \r\n
");
+ Write(
+#line 309 "WelcomePage.cshtml"
+ Resources.WelcomeHeader
+
+#line default
+#line hidden
+ );
+
+ WriteLiteral("
\r\n
");
+ Write(
+#line 310 "WelcomePage.cshtml"
+ Resources.WelcomeStarted
+
+#line default
+#line hidden
+ );
+
+ WriteLiteral("
\r\n
");
+ Write(
+#line 311 "WelcomePage.cshtml"
+ Resources.WelcomeLearnOwin
+
+#line default
+#line hidden
+ );
+
+ WriteLiteral("\r\n \r\n

(
+#line 314 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LearnMore
+
+#line default
+#line hidden
+ , 287037), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 287079), Tuple.Create("\"", 287128),
+ Tuple.Create(Tuple.Create("", 287087), Tuple.Create
(
+#line 314 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LearnMore
+
+#line default
+#line hidden
+ , 287087), false));
+ WriteLiteral(" width=\"58\" height=\"29\" /> \r\n \r\n
");
+ Write(
+#line 316 "WelcomePage.cshtml"
+ Resources.WelcomeLearnMicrosoftOwin
+
+#line default
+#line hidden
+ );
+
+ WriteLiteral("\r\n

(
+#line 318 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LearnMore
+
+#line default
+#line hidden
+ , 289803), false));
+ WriteAttribute("title", Tuple.Create(" title=\"", 289845), Tuple.Create("\"", 289894),
+ Tuple.Create(Tuple.Create("", 289853), Tuple.Create
(
+#line 318 "WelcomePage.cshtml"
+ Resources.WelcomePageImageText_LearnMore
+
+#line default
+#line hidden
+ , 289853), false));
+ WriteLiteral(" width=\"58\" height=\"29\" /> \r\n \r\n
\r\n\r\n\r\n\r\n");
}
}
}
-
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.tt b/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.tt
deleted file mode 100644
index 3808f5d431..0000000000
--- a/src/Microsoft.AspNet.Diagnostics/Views/WelcomePage.tt
+++ /dev/null
@@ -1,50 +0,0 @@
-<#@ template debug="false" hostspecific="true" language="C#" #>
-<#@ assembly name="System.Core" #>
-<#@ assembly name="System.Web.Razor" #>
-<#@ import namespace="System.Linq" #>
-<#@ import namespace="System.Text" #>
-<#@ import namespace="System.IO" #>
-<#@ import namespace="System.Collections.Generic" #>
-<#@ import namespace="System.Web.Razor" #>
-<#@ import namespace="System.Web.Razor.Text" #>
-<#@ output extension=".cs" #>
-<#
-var host = new RazorEngineHost(new CSharpRazorCodeLanguage());
-host.DefaultBaseClass = "Microsoft.Owin.Diagnostics.Views.BaseView";
-var engine = new RazorTemplateEngine(host);
-var path = Host.ResolvePath("WelcomePage.cshtml");
-
-var code = engine.GenerateCode(
- new System.IO.StreamReader(path),
- "WelcomePage",
- "Microsoft.Owin.Diagnostics.Views",
- "WelcomePage.cshtml");
-
-var provider = new Microsoft.CSharp.CSharpCodeProvider();
-var writer = new System.IO.StringWriter();
-provider.GenerateCodeFromCompileUnit(code.GeneratedCode, writer, null);
-var source = writer.ToString();
-var startIndex = 0;
-while(startIndex < source.Length)
-{
- var startMatch = @"Write(@""[[";
- var startCode = @"WriteLiteral(@""";
- var endMatch = @"]]"");";
- var endCode = @""");";
- startIndex = source.IndexOf(startMatch, startIndex);
- if (startIndex == -1)
- {
- break;
- }
- var endIndex = source.IndexOf(endMatch, startIndex);
- if (endIndex == -1)
- {
- break;
- }
- var fileName = source.Substring(startIndex + startMatch.Length, endIndex - (startIndex + startMatch.Length));
- var replacement = File.ReadAllText(Host.ResolvePath(fileName)).Replace("\"", "\"\"");
- source = source.Substring(0, startIndex) + startCode + replacement + endCode + source.Substring(endIndex + endMatch.Length);
- startIndex = startIndex + startCode.Length + replacement.Length + endCode.Length;
- }
-#>
-<#=source#>
diff --git a/src/Microsoft.AspNet.Diagnostics/WelcomePageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/WelcomePageMiddleware.cs
index a37b92cd7e..0236abeaa6 100644
--- a/src/Microsoft.AspNet.Diagnostics/WelcomePageMiddleware.cs
+++ b/src/Microsoft.AspNet.Diagnostics/WelcomePageMiddleware.cs
@@ -48,8 +48,7 @@ namespace Microsoft.AspNet.Diagnostics
{
// Dynamically generated for LOC.
var welcomePage = new WelcomePage();
- welcomePage.Execute(context);
- return Task.FromResult(0);
+ return welcomePage.ExecuteAsync(context);
}
return _next(context);
diff --git a/src/PageGenerator/PageGenerator.kproj b/src/PageGenerator/PageGenerator.kproj
new file mode 100644
index 0000000000..957baaf4c3
--- /dev/null
+++ b/src/PageGenerator/PageGenerator.kproj
@@ -0,0 +1,26 @@
+
+
+
+ 12.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+ 4d4a785a-ecb9-4916-a88f-0fd306ee3b74
+ Console
+
+
+
+
+
+
+ 2.0
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/PageGenerator/Program.cs b/src/PageGenerator/Program.cs
new file mode 100644
index 0000000000..c68c55e9ca
--- /dev/null
+++ b/src/PageGenerator/Program.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Microsoft.AspNet.Razor;
+using Microsoft.Net.Runtime;
+
+namespace PageGenerator
+{
+ public class Program
+ {
+ private readonly ILibraryManager _libraryManager;
+
+ public Program(ILibraryManager libraryManager)
+ {
+ _libraryManager = libraryManager;
+ }
+
+ public void Main(string[] args)
+ {
+ var diagnosticsLibInfo = _libraryManager.GetLibraryInformation("Microsoft.AspNet.Diagnostics");
+ var viewBasePath = Path.Combine(Path.GetDirectoryName(diagnosticsLibInfo.Path), "Views");
+
+ Console.WriteLine("Generating code files for views in {0}", viewBasePath);
+ Console.WriteLine();
+
+ var cshtmlFiles = GetCshtmlFiles(viewBasePath);
+
+ var fileCount = 0;
+ foreach (var fileName in cshtmlFiles)
+ {
+ Console.WriteLine(" Generating code file for view {0}...", Path.GetFileName(fileName));
+ GenerateCodeFile(fileName);
+ Console.WriteLine(" Done!");
+ fileCount++;
+ }
+
+ Console.WriteLine();
+ Console.WriteLine("{0} files successfully generated.", fileCount);
+ Console.WriteLine();
+
+ Console.Write("Press enter to close application...");
+ Console.ReadLine();
+ }
+
+ private static IEnumerable GetCshtmlFiles(string path)
+ {
+ if (!Directory.Exists(path))
+ {
+ throw new ArgumentException("path");
+ }
+
+ return Directory.EnumerateFiles(path, "*.cshtml");
+ }
+
+ private static void GenerateCodeFile(string cshtmlFilePath)
+ {
+ var basePath = Path.GetDirectoryName(cshtmlFilePath);
+ var fileName = Path.GetFileName(cshtmlFilePath);
+ var fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName);
+ var codeLang = new CSharpRazorCodeLanguage();
+ var host = new RazorEngineHost(codeLang);
+ host.DefaultBaseClass = "Microsoft.AspNet.Diagnostics.Views.BaseView";
+ var engine = new RazorTemplateEngine(host);
+
+ using (var fileStream = File.OpenText(cshtmlFilePath))
+ {
+ var code = engine.GenerateCode(
+ input: fileStream,
+ className: fileNameNoExtension,
+ rootNamespace: "Microsoft.AspNet.Diagnostics.Views",
+ sourceFileName: fileName);
+
+ var source = code.GeneratedCode;
+ var startIndex = 0;
+ while (startIndex < source.Length)
+ {
+ var startMatch = @"<%$ include: ";
+ var endMatch = @" %>";
+ startIndex = source.IndexOf(startMatch, startIndex);
+ if (startIndex == -1)
+ {
+ break;
+ }
+ var endIndex = source.IndexOf(endMatch, startIndex);
+ if (endIndex == -1)
+ {
+ break;
+ }
+ var includeFileName = source.Substring(startIndex + startMatch.Length, endIndex - (startIndex + startMatch.Length));
+ includeFileName = SanitizeFileName(includeFileName);
+ Console.WriteLine(" Inlining file {0}", includeFileName);
+ var replacement = File.ReadAllText(Path.Combine(basePath, includeFileName)).Replace("\"", "\\\"").Replace("\r\n", "\\r\\n");
+ source = source.Substring(0, startIndex) + replacement + source.Substring(endIndex + endMatch.Length);
+ startIndex = startIndex + replacement.Length;
+ }
+ File.WriteAllText(Path.Combine(basePath, string.Format("{0}.cs", fileNameNoExtension)), source);
+ }
+ }
+
+ private static string SanitizeFileName(string fileName)
+ {
+ // The Razor generated code sometimes splits strings across multiple lines
+ // which can hit the include file name, so we need to strip out the non-filename chars.
+ //ErrorPage.j" +
+ //"s
+
+ var invalidChars = new List(Path.GetInvalidFileNameChars());
+ invalidChars.Add('+');
+ invalidChars.Add(' ');
+
+ return string.Join(string.Empty, fileName.Where(c => !invalidChars.Contains(c)).ToArray());
+ }
+ }
+}
diff --git a/src/PageGenerator/Project.json b/src/PageGenerator/Project.json
new file mode 100644
index 0000000000..159d891d01
--- /dev/null
+++ b/src/PageGenerator/Project.json
@@ -0,0 +1,20 @@
+{
+ "dependencies": {
+ "Microsoft.AspNet.Diagnostics": "",
+ "Microsoft.Net.Runtime.Interfaces": "0.1.0-alpha-*",
+ "Microsoft.AspNet.Mvc": "0.1.0-alpha-*"
+ },
+
+ "configurations" : {
+ "net45" : {
+ "dependencies": {
+ "System.Runtime": ""
+ }
+ },
+ "k10" : {
+ "dependencies": {
+ "System.Console": "4.0.0.0"
+ }
+ }
+ }
+}