Git Product home page Git Product logo

aspnetcoreroutedebugger's Introduction

AspNetCoreRouteDebugger

An ASP.NET Core Route Debugger implemented as a Razor Page. Read more about Debugging ASP.NET Core Routes.

Sample

Clone the rep. Run the sample project. Navigate to /routes. You should see a list of routes. Note that Razor Pages don't specify controllers/actions for their routes.

Adding to your Project

Grab the two files from the RouteDebuggerPage folder. Drop them into a Pages folder in your ASP.NET Core app (2.0 or greater). Rename if desired (and lock down from public access). Fix namespaces if desired. That should be all you need to do!

I'm Not Using Razor Pages!

Grab the Routes2Controller.cs file, which currently returns JSON. Write a simple page that consumes the JSON (via an API call), or modify the Routes.cshtml file to be a view and have the controller return a view instead. Pull requests accepted if someone wants to make this a bit cleaner.

Original Idea

Credit for the idea behind this sample goes to this issue.

aspnetcoreroutedebugger's People

Contributors

ardalis avatar csharpfritz avatar davidchristiansen avatar dependabot[bot] avatar misinformeddna avatar saibamen 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

Watchers

 avatar  avatar  avatar  avatar  avatar

aspnetcoreroutedebugger's Issues

Navigating to routes give compilation error

I tried to drop in these files to my 'Pages' folder. However, when I attempted to start my application it's giving me the following errors. I'm using a standard .NET Core 2.0 MVC Web App template and not the Pages one. I made sure PreserveCompiliationContext was set to true. Is there something else I need to change to get this working?

An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
Generated Code
One or more compilation references are missing. Ensure that your project is referencing 'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false.

The type or namespace name 'RoutesModel' could not be found (are you missing a using directive or an assembly reference?)
+
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper Html { get; private set; }
The type or namespace name 'RoutesModel' could not be found (are you missing a using directive or an assembly reference?)
+
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary)PageContext?.ViewData;
The type or namespace name 'RoutesModel' could not be found (are you missing a using directive or an assembly reference?)
+
public RoutesModel Model => ViewData.Model;
The type or namespace name 'RoutesModel' could not be found (are you missing a using directive or an assembly reference?)
+
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary ViewData => (global::Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary)PageContext?.ViewData;

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.