Just something simple to try - you may have tried it already. Right click the Solution in solution explorer, click "clean solution", this deletes all the compiled and temporary files associated with a solution. Do a rebuild of the solution and try to debug again.
To disable a breakpoint without deleting it, hover over or right-click it, and select Disable breakpoint. Disabled breakpoints appear as empty dots in the left margin or the Breakpoints window. To re-enable a breakpoint, hover over or right-click it, and select Enable breakpoint.
If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.
Right click on solution --> Properties
Look under Common Properties --> Startup Project
Select multiple startup projects
select Start action on the projects you need to debug.
I had the same issue and after googling I found two typical solutions for this:
Make sure the Silverlight debugger is activated in the .Web project. Open up the project properties and select the Silverlight debugger under the "Web" tab.
Restart Visual Studio and delete all bin and obj folders.
But none of these worked for me. Then someone mentioned far down a thread to try using IE as the browser instead. This made debugging and breakpoints work again!
Edit:
Later I have struggled with IE9 not working, because it attaches to the wrong process. Instead of manually attaching to the correct IE process every time, I found a neat trick:
Now, Visual Studio will launch IE when running the .Web project and attach to the correct process. That should do it.
Whenever I've had this particular error come up, it's turned out that the folder that Visual Studio is loading assemblies from is different from the folder the web-application is running from.
That is, the application server is running the application from
C:\dev\MyApplication\bin
but Visual studio is debugging from
C:\dev\MyOtherApplication\bin (or something along those lines, anyway).
Note - for various reasons, I do my debugging with IIS as the application host instead of the dinky standalone gizmo that most people use. This could influence the usefulness of my answer!
Update:
For IIS the application server directory (i.e. C:\dev\MyApplication
above) is the physical directory configured for the web application - this can be controlled by changing basic settings for the app.
For Visual studio the debugging directory (i.e. C:\dev\MyOtherApplication
above) is the directory in which your svc
files are found, usually the same directory as your csproj
project file.
The problem for me turned out to be that the Properties->Build->Optimize code checkbox had been turned on in the Debug configuration. Turned it off, rebuilt, and debugging worked as normal.
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