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:42

If you don't want this annoying tab to appear, you can try this add-on that I created: http://erwinmayer.com/labs/visual-studio-2010-extension-disable-no-source-available-tab/

It is directly downloadable on the Visual Studio Gallery: http://visualstudiogallery.msdn.microsoft.com/en-us/fdbb2036-471e-40a7-b20e-31f8fd5578fa

查看更多
Ridiculous、
3楼-- · 2019-01-13 20:42

I had the same problem in an unmanaged C++ program: when debugger was in main function it always showed "No source code available" and, what was interesting, other functions in this file was shown without problems. In this case, the problem was that I allocated too much data on the stack. After reducing it, the debugger started to work without problems.

It was in Visual Studio 2010.

查看更多
Explosion°爆炸
4楼-- · 2019-01-13 20:43

One way, that also works for Express Editions of Visual Studio (say, Visual Basic 2005 Express Edition), is to rename the .suo file. It is in the same folder as the solution file, .sln. Exit Visual Studio before renaming the file.

Screenshot of Windows Explorer with a .suo file highlighted

The .suo file contains non-critical settings, like window positions, etc. However, it also contains all the breakpoints which is why it is probably better to rename it than delete it in case this action is regretted.

查看更多
贼婆χ
5楼-- · 2019-01-13 20:43

Have you tried to build that page? I had an issue with something similar with AjaxControlToolkit: Modal Popup Extender. It did not show until I gave it CSS and ASP.NET controls.

查看更多
▲ chillily
6楼-- · 2019-01-13 20:48

Here's what I did to solve this problem. First, stop debugging and just have your solution open in VS. Next, make sure your solution config is set to Debug as opposed to Release. Then simply do a Rebuild (not Build, Rebuild). The next time you fire up the debugger, it should function as normal and you shouldn't get that error message.

Hope this helps!

查看更多
ゆ 、 Hurt°
7楼-- · 2019-01-13 20:53

Check if your projects have a project reference, not a DLL reference! If there exists a DLL reference, your changes will not be recognized by your referenced project, and you will get an error message like yours.

查看更多
登录 后发表回答