GithubHelp home page GithubHelp logo

ediwang / edi.routedebugger Goto Github PK

View Code? Open in Web Editor NEW
46.0 46.0 7.0 176 KB

ASP.NET Core Middleware to show current route info and all routes

License: MIT License

C# 52.09% HTML 34.52% CSS 11.46% JavaScript 1.92%
asp-net-core

edi.routedebugger's Introduction

GitHub stats

edi.routedebugger's People

Contributors

anduin2017 avatar bramborman avatar drittich avatar ediwang avatar leafrock 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

Watchers

 avatar  avatar  avatar

edi.routedebugger's Issues

Cannot Access A Closed Stream in app.UseExceptionHandler when Route Debugger is enabled

I hit an issue this morning which I've tracked down to this route debugger package. I no longer actually need the route debugger so I'll be removing the package from my project this morning, just letting you know what happened.

In Startup.cs public void Configure, I have an exception handler, followed further down by the route debugger.

app.UseExceptionHandler(a => a.Run(async context => {
   await context.Response.WriteAsync("anything"); // <-- throws `Cannot access a closed stream`
});
...
if (env.IsDevelopment()) { app.UseRouteDebugger(); } // <-- Commenting out this line makes the problem go away

The way I invoked an exception to cause the exception handler to be called was simply by throwing a new Exception on the first line of a controller action.

I'm not sure exactly why this happens and I'm afraid I don't have the time at to dig any further into it, but I'm pretty sure you must have something in UseRouteDebugger that is latching on to the HttpContext's response object and finalizing it's stream in such a way as to prevent other middleware from manipulating it. I tried, clearing the response, finalizing and flushing it myself, nothing worked.

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.