Just wanted to write about a baffling problem I came across while debugging my web service in Visual Studio 2008.
I was running in debug mode and when I called a method that I had set up breakpoints in, I kept getting an error stating “There is no source code available at this location”.

As always, one should take a step back and try to understand the issue.
The message seemed to indicate that the assembly debug symbols/information and code were out of sync. To verify that, I made a change to the names to one of my web service methods and sure enough, the (auto-generated) debug page for an asmx still showed the old method name. Clearly, my code was not being built.
I fixed the problem by checking the Build checkbox (which somehow got unchecked) in the Solution – Properties – Configuration VS dialog.
As a side, always ensure that your assemblies are built the way you assume they are. Maybe, even delete the dll files to be sure and then do a build/debug and ensure that, if you’re using Internet Explorer to debug), the “Show friendly errors” and “Disable debugging” is off.

Advertisements