Web API in MVC Project isn't hitting breakpoints ("symbols not loaded")
Until you find a permanent solution you can use the method System.Diagnostics.Debugger.Break()
to force a break to occur on that line - just like a breakpoint:
public ActionResult IndexCheckInOut(string providerKey, DateTime? date = null)
{
System.Diagnostics.Debugger.Break();
return View("Index");
}
Here are some links to articles that might help you find a more permanent solution:
The breakpoint will not currently be hit
Stepping into ASP.NET MVC source code with Visual Studio debugger
Possible solution: I had forgotten that I was previously doing some remote debugging and had set debug symbols to be loaded from a UNC path instead of the Microsoft Symbol Servers.
To fix this head to: Tools -> Options -> Debugging -> Symbols -> Make sure 'Microsoft Symbol Servers' is checked.
I also found this issue from creating a new Solution Configuration and not basing it on any existing configuration, such as the DEBUG configuration. That caused Debug Info
to be set to none
.
To fix this: Right-click your project -> Properties -> Build -> Make sure your faulty Solution Configuration is set -> click Advanced
-> change Debug Info
to full
.
For me it worked out to just stop IIS and restart Visual Studio. Definitely worth a try before further investigation.