I have a Windows Forms application in a single project written in VB.NET 2003 (legacy code). There is a MainForm and a SecondaryForm that is run by the MainForm. When I run the application through the MainForm, I can debug without any problems.
However, if I just run the SecondaryForm, I get the debug error:
There is no source code available for the current location
when st开发者_如何学JAVAepping over:
_routeId = CInt(myVar)
At this point I am no longer able to debug through my code window, but I have to use the disassembled code.
Why does this happen and how can I fix it?
My problem was of the Step-Into kind. I could step into a procedure inside a usercontrol just fine, but when its End Sub was encountered and I was leaving that Sub, I would get the "There is no source code available for the current location." error page.
The solution that personally worked for me was: In the Project Properties page, under "Debug", uncheck "Enable unmanaged code debugging".
I have seen this issue many times... and more often than not it is a reference(s) issue. Is it your code that has "no source" or is it Microsoft code? Do you have multiple versions of the .NET Framework installed?
Double check your references.
精彩评论