Getting rid of “There is no source code available

2019-01-13 20:09发布

OK, this is my own fault, but I can't seem to rescue myself.

Whenever I try to step into a class that has fields with assignments calling into .NET code, I get a dialog box that contains the text "There is no source code available for the current location.":

Screenshot of error message

For instance, stepping into the constructor of the following class would give me the above message:

public class Test
{
    private Stack<String> _Dummy = new Stack<String>();
    public Test() { }
}

I assume this is because at some point I fiddled with the settings for the symbol server, but no matter what I fiddle with now, I can't seem to get rid of that message.

Where has my stupidity forgotten what it did?


Summary of my current options:

  • [ ] Enable address-level debugging
  • [x] Enable Just My Code (Managed Only)
  • [ ] Enable .NET framework source stepping
  • [ ] Enable source server support
  • Symbol file .pdb locations - empty
  • Cache symbols from symbol servers to this directory: C:\temp (empty)

14条回答
别忘想泡老子
2楼-- · 2019-01-13 20:30

In Solution Explorer, check your solution property page under Common Properties, Debug Source Files. If you see the assembly listed under "Do not look for these source files:", delete it and the issue should go away.

Open the solution property page

Screenshot of right clicking on the solution in Visual Studio's Solution Explorer

Check "Do not look for these source files"

Screenshot of the solution property pages in Visual Studio solution

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-13 20:33

This is how I solved it.

Right click your project -> Properties - > Compile -> Advanced Compile Options...

Then Set 'Generate debug info' to 'Full' from the drop down menu.

Hope that helps.

查看更多
SAY GOODBYE
4楼-- · 2019-01-13 20:35

This worked for me:

  1. Check the "Enable Unmanaged Code Debugging" on the properties page for the referenced *.DLL
  2. Recompile referenced *.DLL
  3. Remove and then re-add the referenced *.DLL to your project
查看更多
放我归山
5楼-- · 2019-01-13 20:35

I had the same problem, and I solved it on this way (Visual Studio 2008):

"Formato de la informacion de depuracion" to "Base de datos de programa (/Zi)"

Enter image description here

查看更多
一纸荒年 Trace。
6楼-- · 2019-01-13 20:37

See if some source files are accidentally excluded. Do properties of the solution and look at the Debug Source Files section under Common Properties.

查看更多
▲ chillily
7楼-- · 2019-01-13 20:37

This error made me go crazy as well. I was using 'AjaxControlToolkit' and had referenced it using 'Add Reference' to my project.

I deleted the 'AjaxControlToolkit' reference and added the same with 'Add Existing Item' and after that I had no problems at all...

查看更多
登录 后发表回答