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
View
I had the same issue but mine was related to the addition of a config Transform. Go to Build > Configuration Manager under Active Solution Configuration make sure you have Debug selected.
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
.
This solved my problem:
IIS Express
in the system tray (beside the Windows clock).bin
and obj
folders in your project directoryUntil 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
Just had this issue myself and was tearing my hair out for about an hour until I realised Visual Studio had mysteriously switched to run the project in 'Release' mode. Switching back to 'Debug' mode and rebuilding sorted me out.
Probably a very niche answer to this problem, but hopefully this helps somebody.
For me it worked out to just stop IIS and restart Visual Studio. Definitely worth a try before further investigation.