I have an ASP.NET MVC project, with an ASP.NET web api defined as an area in this project. So the structure is the following:
MVC Web
Controllers
Views
Areas
API (web API)
Controllers
The app works as expected. However, I am having an issue with debugging. I can put a debugger in the MVC controller, and it works as expected. I cannot put a breakpoint in the web API controller, as I get "the breakpoint will not currently be hit. No symbols have been loaded for this document." I've been in the throes of it for some time, so it's probably a simple fix but I cannot figure it out. Any ideas why I'm getting this problem with web API controllers, when I can debug an MVC controller?
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
For me it worked out to just stop IIS and restart Visual Studio. Definitely worth a try before further investigation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With