开发者

How do I reset Visual Studio so that it once again searches for source files of DLLs while debugging?

In the process of debugging my WPF project, I regularly encounter thrown exceptions. When these exceptions fire, if the exception is thrown by my application's code, I am able to browse the source code. All is well.

HOWEVER, if an exception is thrown by code hosted in another assembly (that we built), I am unable to browse for the source code. I was at some point in the past prompted to browse for the original source code file, but "canceled" the dialog. Now, I want a do-over.

Is there a way to grant me a do-over on locating these source files? I'm no longer prompted for them. I assume Visual Studio stores my source code browsing preferences somewhere, b开发者_运维问答ut I don't know where. I get the idea this do-over is possible, but I don't even know the words to search for on Google to get what I want.

What should I do?


In the Solution Explorer right click on the solution and go to PropertiesCommon PropertiesDebug Source Files.

Then on the right hand side there is a list for "Do not look for these source files:". Deleting the entry from that list should prompt you for the source location again.


Delete the hidden .suo file in your solution directory.


You may have to reset the visual settings. You can do this by clicking "Tools", Import Export settings.

For the default source path, make sure your PDB files are replaced correctly where Visual Studio is adding your reference DLL from. The PDB file contains the path of the source code, it's not Visual Studio.

You must rebuild your project (referenced assemblies one) and manually delete PDB files in your debugging project before adding references. It may be a bug in Visual Studio in case the files are locked or if for some reason the PDB files may not be updated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜