Visual Studio: Debugging a referenced DLL, I have source in another SLN

廉价感情. 提交于 2019-12-02 15:03:00
Knaģis

Rebuild the second solution in Debug mode on your own machine (so that file paths in that PDB are specific to your machine).

Copy both the .DLL and .PDB files to your references folder. Visual Studio will pick up the .PDB file automatically and use the file paths to show source.

You can also use Symbol Server and Source Server to achieve this when the referenced assembly is built elsewhere: http://msdn.microsoft.com/en-us/library/vstudio/ms241613.aspx

I got the solution by doing the below

Try disabling Just My Code (JMC).

Tools -> Options -> Debugger Uncheck "Enable Just my Code"

I had same problem which I resolved by cleaning and rebuilding the solution . It will correct references in .pdb files to locate and hit the break point in second project.

When you do a Debug build, all of the dll and pdb files are established in the host project. So there should be no need to copy files manually.

Right-Click on the Solution, select Add/Existing Project... Navigate to the Class lib folder and select the proj file (e.g. myproj.csproj). The files are not copied, just referenced and you can open the source for the class in the IDE and set breakpoints in the normal way and it just works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!