Giter Club home page Giter Club logo

diagnostics's Introduction

ASP.NET Core Diagnostics [Archived]

This GitHub project has been archived. Ongoing development on this project can be found in https://github.com/aspnet/AspNetCore.

Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors.

This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the AspNetCore repo.

diagnostics's People

Contributors

ajaybhargavb avatar ajcvickers avatar andriysvyryd avatar anpete avatar aspnetci avatar brennanconroy avatar bricelam avatar chengtian avatar damianedwards avatar davidfowl avatar dougbu avatar eilon avatar haok avatar henkmollema avatar javiercn avatar juntaoluo avatar kichalla avatar mikary avatar mikeharder avatar natemcmaster avatar ntaylormullen avatar pakrym avatar pranavkm avatar rowanmiller avatar ryanbrandenburg avatar rynowak avatar smitpatel avatar sonjakhan avatar tratcher avatar troydai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diagnostics's Issues

Allow simple custom error pages for specific HTTP status codes

IIS provides a mechanism for configuring custom pages/files to be shown when specific HTTP status codes occur, e.g. show 404.html when a 404 happens.

We should have a similar feature that works cross-server and is provided by the diagnostics package.

Error page needs to have an easily copyable exception message and stack trace

Similar to #12

Currently when an unhandled exception occurs, following is the html output that we see...as you can imagine this makes it difficult to copy the stack trace and send it out to someone to take a look....

    <body>
        <h1>An unhandled exception occurred while processing the request.</h1>
                <h2 class="titleerror">OutOfMemoryException: Exception of type &#39;System.OutOfMemoryException&#39; was thrown.</h2>
                    <p class="location">System.Data.SqlClient.TdsParser.ProcessSSPI(Int32 receivedLength) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\TdsParser.cs">TdsParser.cs</code>, line 5751</p>
                <h2 class="titleerror">DataStoreException: An error occured while running a data store operation. See InnerException for details.</h2>
                    <p class="location">Microsoft.Data.Entity.Query.EntityQueryExecutor.EnumerableExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()</p>
        <ul id="header">
                <li id="stack" tabindex="1" class="selected">
                    Stack
                </li>
                            <li id="query" tabindex="2">
                    Query
                </li>
                            <li id="cookies" tabindex="3">
                    Cookies
                </li>
                            <li id="headers" tabindex="4">
                    Headers
                </li>
                            <li id="environment" tabindex="5">
                    Environment
                </li>
        </ul>
            <div id="stackpage" class="page">
                <ul>

                        <li>
                            <h2 class="stackerror">OutOfMemoryException: Exception of type &#39;System.OutOfMemoryException&#39; was thrown.</h2>
                            <ul>
                                <li class="frame" tabindex="6">

                                        <h3>System.Data.SqlClient.TdsParser.ProcessSSPI(Int32 receivedLength) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\TdsParser.cs">TdsParser.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="7">

                                        <h3>System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\TdsParser.cs">TdsParser.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="8">

                                        <h3>System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\TdsParser.cs">TdsParser.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="9">

                                        <h3>System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlInternalConnectionTds.cs">SqlInternalConnectionTds.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="10">

                                        <h3>System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, String newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlInternalConnectionTds.cs">SqlInternalConnectionTds.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="11">

                                        <h3>System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, String newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlInternalConnectionTds.cs">SqlInternalConnectionTds.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="12">

                                        <h3>System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, String newSecurePassword, Boolean redirectedUserInstance) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlInternalConnectionTds.cs">SqlInternalConnectionTds.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="13">

                                        <h3>System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, String newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlInternalConnectionTds.cs">SqlInternalConnectionTds.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="14">

                                        <h3>System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlConnectionFactory.cs">SqlConnectionFactory.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="15">

                                        <h3>System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\ProviderBase\DbConnectionFactory.cs">DbConnectionFactory.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="16">

                                        <h3>System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\ProviderBase\DbConnectionFactory.cs">DbConnectionFactory.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="17">

                                        <h3>System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\ProviderBase\DbConnectionClosed.cs">DbConnectionClosed.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="18">

                                        <h3>System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlConnection.cs">SqlConnection.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="19">

                                        <h3>System.Data.SqlClient.SqlConnection.Open() in <code title="C:\BuildAgent\work\7894bcffbd50f0b2\src\System.Data.SqlClient\System\Data\SqlClient\SqlConnection.cs">SqlConnection.cs</code></h3>

                                </li>
                                <li class="frame" tabindex="20">

                                        <h3>Microsoft.Data.Entity.Relational.RelationalConnection.Open()</h3>

                                </li>
                                <li class="frame" tabindex="21">

                                        <h3>Microsoft.Data.Entity.Relational.Query.QueryMethodProvider.Enumerable`1.Enumerator.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="22">

                                        <h3>System.Linq.Enumerable.&lt;SelectManyIterator&gt;d__14`2.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="23">

                                        <h3>System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="24">

                                        <h3>Microsoft.Data.Entity.Query.EntityQueryExecutor.EnumerableExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()</h3>

                                </li>
                            </ul>
                        </li>
                        <li>
                            <h2 class="stackerror">DataStoreException: An error occured while running a data store operation. See InnerException for details.</h2>
                            <ul>
                                <li class="frame" tabindex="25">

                                        <h3>Microsoft.Data.Entity.Query.EntityQueryExecutor.EnumerableExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="26">

                                        <h3>System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)</h3>

                                </li>
                                <li class="frame" tabindex="27">

                                        <h3>System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)</h3>

                                </li>
                                <li class="frame" tabindex="28">

                                        <h3>Microsoft.AspNet.Identity.EntityFramework.UserStore`4.GetClaimsAsync(TUser user, CancellationToken cancellationToken)</h3>

                                </li>
                                <li class="frame" tabindex="29">

                                        <h3>Microsoft.AspNet.Identity.UserManager`1.&lt;GetClaimsAsync&gt;d__1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="30">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="31">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="32">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="33">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="34">

                                        <h3>Microsoft.AspNet.Identity.ClaimsIdentityFactory`2.&lt;CreateAsync&gt;d__1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="35">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="36">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="37">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="38">

                                        <h3>Microsoft.AspNet.Identity.SignInManager`1.&lt;CreateUserIdentityAsync&gt;d__1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="39">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="40">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="41">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="42">

                                        <h3>Microsoft.AspNet.Identity.SignInManager`1.&lt;SignInAsync&gt;d__1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="43">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="44">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="45">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="46">

                                        <h3>Microsoft.AspNet.Identity.SignInManager`1.&lt;SignInOrTwoFactorAsync&gt;d__1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="47">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="48">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="49">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="50">

                                        <h3>Microsoft.AspNet.Identity.SignInManager`1.&lt;PasswordSignInAsync&gt;d__1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="51">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="52">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="53">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="54">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()</h3>

                                </li>
                                <li class="frame" tabindex="55">

                                        <h3>MusicStore.Controllers.AccountController.&lt;Login&gt;d__2.MoveNext() in <code title="C:\StressTestingApps\3f69ca46422246978dc5e6941ccf0caf\3f69ca46422246978dc5e6941ccf0caf\Controllers\AccountController.cs">AccountController.cs</code></h3>

                                        <div class="source">
                                                <ol start="34" class="collapsible">
                                                        <li><span>        [AllowAnonymous]</span></li>
                                                        <li><span>        [ValidateAntiForgeryToken]</span></li>
                                                        <li><span>        public async Task&lt;IActionResult&gt; Login(LoginViewModel model, string returnUrl = null)</span></li>
                                                        <li><span>        {</span></li>
                                                        <li><span>            if (ModelState.IsValid)</span></li>
                                                        <li><span>            {</span></li>
                                                </ol>

                                            <ol start="40" class="highlight">
                                                <li><span>                var signInStatus = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false);</span></li></ol>

                                                <ol start='41' class="collapsible">
                                                        <li><span>                switch (signInStatus)</span></li>
                                                        <li><span>                {</span></li>
                                                        <li><span>                    case SignInStatus.Success:</span></li>
                                                        <li><span>                        return RedirectToLocal(returnUrl);</span></li>
                                                        <li><span>                    case SignInStatus.LockedOut:</span></li>
                                                        <li><span>                        ModelState.AddModelError(&quot;&quot;, &quot;User is locked out, try again later.&quot;);</span></li>
                                                </ol>
                                        </div>
                                </li>
                                <li class="frame" tabindex="56">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="57">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="58">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)</h3>

                                </li>
                                <li class="frame" tabindex="59">

                                        <h3>Microsoft.AspNet.Mvc.ReflectedActionExecutor.&lt;CastToObject&gt;d__2`1.MoveNext()</h3>

                                </li>
                                <li class="frame" tabindex="60">

                                        <h3>--- End of stack trace from previous location where exception was thrown ---</h3>

                                </li>
                                <li class="frame" tabindex="61">

                                        <h3>System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)</h3>

                                </li>
                                <li clas

Improve design of default error page

It was mentioned in the NDC London talk that the design of the current error page could be improved to be more inline with the Helios error page. I wouldn't mind having a crack at this but didn't want to start without the go ahead. Note, this work wouldn't fix the problems with this page that other issues have brought up, it would just "improve" the design. // @DamianEdwards @davidfowl (it was during their talk)

Support middleware (or Elm option) to log errors to the Windows Event Log

ASP.NET 4 and older logs escaped exceptions to the Windows Event Log with the event ID 1309. This seems like a good middleware to have in Diagnostics to also make it hosting-independent (although maybe not platform-independent; Mono seems to do wildly different things depending on configuration). Unsure if this is best implemented as a standalone middleware or as an option to the Elm infrastructure (maybe because Elm isn't really detailed anywhere; it seems like an exception VCR and the name hints at ELMAH).

Enviroment tab in error page middleware

This error page middleware is a port of the katana error page middleware where OWIN environment existed. So we had a Environment tab in the error page output listing all the environment variables. In Aspnet vNext there is no environment but we have features.

What do we do with this Environment tab in the error page. Options

  1. Remove it as it not relevant any more
  2. Provide any other information like features - Will that be any useful for developer?

Elm: Log order

The scopes are ordered with the newest on top, but the logs inside of the scope are ordered oldest on top. This make reading consecutive scopes confusing, especially when there are logs that are not part of a scope (e.g. server logs before the scope is established).

Pick a consistent order.

Stretch: Let the order be selected in the UI.

how to customize diagnostic?

I was looking the Diagnostic sources. How can I customize the pages and/or add logging capabilities, for example sending email when I have exceptions?

ElmScope disposes incorrect instance

The scopes are built on the assumption that they will be disposed in the order they were pushed. ElmScope.Push needs to be updated so the ElmScope that is pushed is the one that is disposed, not Current, which may not be the scope that was pushed.

Error page middleware does not show method names on mono

Wire up error page middleware and throw an exception:

Before:

An unhandled exception occurred while processing the request.
Exception: Hey what's up
<filename unknown>:0
• Stack 
• Query 
• Cookies 
• Headers 
• Environment
• Exception: Hey what's up
o   <filename unknown>:0
o   (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0
o   --- End of stack trace from previous location where exception was thrown ---
o   <filename unknown>:0
o   <filename unknown>:0
o   <filename unknown>:0

Create custom status code middleware

Consider the case where you want your application to return a nice 404 page, (or any other status code). It's impossible to find all the places in your pipeline that might return those status codes, so you want to handle them as they come back.

Proposal: A centralized middleware that can intercept responses by status code and re-execute them to generate a different response. e.g. intercept 404s (with or without a body?), change the path to /NotFound/ and re-execute the request and let MVC generate a full page. Compare with the ErrorHandler middleware that does this for unhandled exceptions. This one will need to be a little more complicated because you'll want to configure it per status code.

Prototype:
https://github.com/aspnetvnexthackathon/CustomStatusCodes

Add razor tt generation support in the build infrastructure

The views are designed to be generated at compile time from cshtml files, via tt files, to cs files. The current K build infrastructure doesn't recognize tt files, so the auto-generation isn't happening and you have to update the cs files by hand.

ElmScope.Push NullReferenceException

Push creates a new scope node, sets it as the Current scope (CallContext/AsyncLocal) and returns a DisposableAction to undo the change. If the dispose action is invoked on thread where Current returns null (e.g. the context was lost on a thread hop), the action null refs.

Check for null Current in the dispose action.

UseWelcomePage is too greedy

From @richlander on August 6, 2014 15:49

Experience:

  • Create empty ASP.NET vNext project in VS
  • Add text file to project
  • Launch site
  • Type URL for text file
  • Server returns file. Yeahh!
  • Add app.UseWelcomePage()
  • Type URL for text file
  • Server does not return file. Bad.
  • Add app.UseStaticFiles();
  • Type URL for text file
  • Server returns file. Yeahh.

The text file should still be returned in the case that startup.cs only includes app.UserWelcomePage().

Copied from original issue: dotnet/aspnetcore#113

app.UseErrorPage fails with incomplete HTML on OS X

Title

app.UseErrorPage fails with incomplete HTML on OS X

Functional impact

When an error occur, e.g. internal server error the error page just shows a blank page with incomplete HTML markup like this:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title>Internal Server Error</title>
        <style>
            body {
    font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;
    font-size: .813em;
    line-height: 1.4em;
    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;
}

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 li:hover {
            background: #a9e4f9;
            color: #fff;
        }

        #header .selected {
            background: #44c5f2;
            color: #fff;
        }

#stackpage ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    /*border-bottom: 1px #ddd solid;*/
}

#stackpage .stackerror {
    padding: 5px;
    border-bottom: 1px #ddd solid;
}

    #stackpage .stackerror:hover {
        background-color: #f0f0f0;
    }

#stackpage .frame:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

#stackpage .frame {
    padding: 2px;
    margin: 0 0 0 30px;
    border-bottom: 1px #ddd solid;
    cursor: pointer;
}

    #stackpage .frame h3 {
        padding: 5px;
        margin: 0;
    }

#stackpage .source {
    padding: 0;
}

    #stackpage .source ol li {
        font-family: Consolas, "Courier New", courier, monospace;
        white-space: 

Minimal repro steps

Create an empty MVC application using e.g yeoman, throw a new Exception(); in the HomeController

Expected result

A complete error page with stack trace

Actual result

A blank page with incomplete HTML

Moved from aspnet/Mvc#1108
/cc: @marcuslindblom

RuntimeInfo could display assemblies loaded

If RuntimeInfo displays assemblies inside packages and where they are loaded from then it would help you identify if a package has been serviced and if an assembly is loaded from a global cache instead of locally with the app.

Error page should suppress Task stack frames

With an async/await pipeline it's very common for there to be lots of Task based stack frames. Consider the following example:

Stack trace:

Microsoft.AspNet.PipelineCore.DefaultHttpResponse.SignIn(IEnumerable`1 identities, AuthenticationProperties properties)
Microsoft.AspNet.Http.HttpResponse.SignIn(ClaimsIdentity identity, AuthenticationProperties properties)
Microsoft.AspNet.Identity.Authentication.HttpAuthenticationManager.SignIn(ClaimsIdentity identity, Boolean isPersistent) in HttpAuthenticationManager.cs
            Context.Response.SignIn(identity, new AuthenticationProperties { IsPersistent = isPersistent });
Microsoft.AspNet.Identity.SignInManager`1.<SignInAsync>d__1.MoveNext() in SignInManager.cs
            AuthenticationManager.SignIn(userIdentity, isPersistent);
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.TaskAwaiter.GetResult()
Microsoft.AspNet.Identity.Authentication.SecurityStampValidator.<>c__DisplayClass1`1.<<OnValidateIdentity>b__3>d__0.MoveNext() in SecurityStampValidator.cs
                        await manager.SignInAsync(user, isPersistent);
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Cookies.CookieAuthenticationHandler.<AuthenticateCoreAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Infrastructure.AuthenticationHandler.<BaseInitializeAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNet.Diagnostics.ErrorPageMiddleware.<Invoke>d__1.MoveNext()

Too much of this is noise. Can we suppress / de-emphasize some of these frames?

Microsoft.AspNet.PipelineCore.DefaultHttpResponse.SignIn(IEnumerable`1 identities, AuthenticationProperties properties)
Microsoft.AspNet.Http.HttpResponse.SignIn(ClaimsIdentity identity, AuthenticationProperties properties)
Microsoft.AspNet.Identity.Authentication.HttpAuthenticationManager.SignIn(ClaimsIdentity identity, Boolean isPersistent) in HttpAuthenticationManager.cs
            Context.Response.SignIn(identity, new AuthenticationProperties { IsPersistent = isPersistent });
Microsoft.AspNet.Identity.SignInManager`1.<SignInAsync>d__1.MoveNext() in SignInManager.cs
            AuthenticationManager.SignIn(userIdentity, isPersistent);
...
Microsoft.AspNet.Identity.Authentication.SecurityStampValidator.<>c__DisplayClass1`1.<<OnValidateIdentity>b__3>d__0.MoveNext() in SecurityStampValidator.cs
                        await manager.SignInAsync(user, isPersistent);
...
Microsoft.AspNet.Security.Cookies.CookieAuthenticationHandler.<AuthenticateCoreAsync>d__1.MoveNext()
...
Microsoft.AspNet.Security.Infrastructure.AuthenticationHandler.<BaseInitializeAsync>d__1.MoveNext()
...
Microsoft.AspNet.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__1.MoveNext()
...
Microsoft.AspNet.Diagnostics.ErrorPageMiddleware.<Invoke>d__1.MoveNext()

Suppress caching for ErrorHandler

When using the ErrorHandler to re-execute a failed request and generate a page, that error page should not be cached. However, components like the static file middleware cache by default via e-tags.

Consider modifying the samples to manually add no-cache headers on the app-error path, or modify the middleware itself to set these no-cache headers. before re-executing the request.

Error page middleware returns an empty body on mono

ErrorPage middleware where ShowExceptionDetails flag is turned on returns an empty page in mono. For example the below sample application. Turning this flag on get the page working, but exception information is the critical part.

public void Configure(IBuilder app)
        {
            app.UseErrorPage(new ErrorPageOptions()
                {
                    ShowCookies = true,
                    ShowEnvironment = true,
                    ShowExceptionDetails = false, //Turn this on to see an empty body.
                    ShowHeaders = true,
                    ShowQuery = true,
                    ShowSourceCode = true,
                    SourceCodeLineCount = 10
                });

            app.Run (async context => {
                throw new System.Exception("Hello world");
                await context.Response.WriteAsync("Hello world");
            });
}

ELM: Need steps required for installing ELM into a project

I am trying to use elm but I am getting exceptions that the Form could not be read. Why should there be a form if i am accessing /Elm using the browser address bar directly? Also could the steps needed to use elm be published so that I could check if what I am doing is correct?

Error Page: regression: In Mono function names now show up but without file names/line info

If I enable my compiler's debug functionality (I am not using c#), and let an exception get caught by the error page middle ware I do not get t see the file names and line numbers present in the exception stack trace. Before the fix done in #50 I could not see function names (fixed by that PR) but I could see the file names and line numbers whenever i enabled debug mode while compiling and passed --debug to mono.

Elm : Log page view should preserve the order in which the messages were logged

For the following piece of code:

app.Run(async context =>
{
    logger.WriteInformation("A");

    using (logger.BeginScope("'Scope 1'"))
    {
        logger.WriteInformation("B");

        using (logger.BeginScope("'Scope 1.1'"))
        {
            logger.WriteInformation("C");
        }

        logger.WriteInformation("D");
    }

    logger.WriteInformation("E");

    await context.Response.WriteAsync("Hello world");
})

Was expecting the order of the state to be something like:

Beginning request <guid>
    A
    Beginning 'Scope 1'
        B
            Beginning 'Scope 1.1'
            C
            Completed 'Scope 1.1'
        D
    Completed 'Scope 1'
    E
    Sending Response: <response details>
Completed request <guid>

But got something like the following:
image

Elm: Generalize request details page

The request details page is only accessible if the scope if tied to a request. Update so that we can see log details even if the logs are not in a request scope

Create error page debug middleware

Port existing modern screen of death middleware.

To be used only for development configuration in templates.

Feature where you get a callback asking if you want to enable error pages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.