Create an ASP.NET Core web app

Debug your App

  1. Open the Controllers/HomeController.cs class by double-clicking it the Solution pad on the left-hand side of the screen.

  2. This ASP.NET Core project uses the MVC architecture, which follows a standard convention. By default, a controller like HomeController will handle all web requests to www.mydomain.com/Home and route them to the method matching the rest of the path.

  3. Locate the Index method. This method will handle requests to www.mydomain.com/Home/Index. Note that there are also methods for About and Contact. The project is configured by default to load the page at /Home/Index.

  4. Click the editor margin to the left of the return View() line of code in Index to set a breakpoint. A breakpoint is used to stop execution of the app at that point and debug your app.

    Code screenshot

  5. Click the Start Debugging button (with a Play icon) on the top left to build and start debugging the app. Alternatively, you can also start debugging by selecting the Run -> Start Debugging menu item.

  6. When the application hits the line of code with the breakpoint, it stops executing and you will have access to a full array of debugging tools, including the call stack, variable inspectors, and more.

  7. Click the Continue Running (the new Play icon in the group of 4) button to continue executing the code.

  8. The app will appear in your browser.

    Debug screenshot


I ran into an issue I have run my app