Search code examples
asp.net-core-mvcvisual-studio-debugging

Debugging not hit breakpoints in .NET CORE MVC 6 application


I am working on .NET CORE 1.0 MVC 6 application and I stuck with the debugging point as it stopping hitting yesterday. with number of try I delete project and start again. First time it load symbols even due I have uncheck in Tool --> Debugging --> symbols, however it hit breakpoints. Now it only hitting C# class 'Startup.cs' if I choose 'Enable Just My Code' but in controller. I have Debug option from dropdown, not really sure why. Need help here.

enter image description here

enter image description here

enter image description here

I change as

Select Debug->Options->Debugging->General

Tick Enable .NET Framework source stepping.

but still no success

enter image description here

Module

enter image description here

Trying to Hit in Controller home class for MVC Core in Index and about

 public class HomeController : Controller
{
    public IActionResult Index()
    {
        var x = 2 + 3;

        return View();
    }

    public IActionResult About()
    {
        var x3 = 2 + 6;
        var xx = "dd";

        ViewData["Message"] = "Your application description page.";

        return View();
    }

Debugging output

enter image description here


Solution

  • actually your screen shot was not the debug output, it was the build output.

    If you disable the "Enable Just My Code", and enable/disable the Microsoft symbols Server under TOOLs->Options->Debugging->Symbols, and then debug your app after you re-open it, how about the result?

    If I create a new app, the breakpoint was hit normally, if I re-open the solution, actually it still could hit the breakpoint, but it is very slow. Like the screen shot 1, if you visit the "debug" output window, it would list the symbols loaded one by one, after about 1min, it would hit the breakpoint like screen shot 2. Of course, I enabled the Microsoft symbols under TOOLS->Options->Debugging->Symbols and disabled the Enable Just My Code for the above steps.

    So for your issue, one possible reason is that it just loads the symbols slowly, just wait for a moment.

    enter image description here

    enter image description here