[英]Debugging referenced DLL in Visual Studio
I have multiple projects (lets call one MyLibrary
) in Visual Studio that contains a lot of nifty functions and classes I use in my other projects. 我在Visual Studio中有多个项目(叫一个
MyLibrary
),其中包含很多我在其他项目中使用的漂亮函数和类。 I add a reference to MyLibrary.dll
directly and not the project itself. 我直接添加对
MyLibrary.dll
的引用,而不是项目本身。
However, I now need to breakpoint my way through something in MyLibrary
while I run one of my other projects. 但是,当我运行其他项目之一时,我现在需要断点
MyLibrary
。 How can I debug my dll the way I've set up my projects? 如何以设置项目的方式调试dll? I know for a fact I've done it earlier with these projects, but since I didn't do anything special, I don't know what's missing.
我知道事实上我已经在这些项目中做过,但是由于我没有做任何特别的事情,所以我不知道缺少什么。
I've turned off Just-my-code and followed some tips like that, but I haven't gotten into .pdb's
yet. 我关闭了Just-my-code,并遵循了一些类似的提示,但是我还没有涉足
.pdb's
。 If I need one to debug another DLL, I would appreciate some information on how to export that from MyLibrary
. 如果我需要调试另一个DLL,我将不胜感激有关如何从
MyLibrary
导出该信息的一些信息。
You might need to go to the properties of a DLL, and ensure that Copy Local is set to True. 您可能需要转到DLL的属性,并确保将“本地复制”设置为True。 Otherwise, Modules won't be able to find the .pdb for your reference
否则,模块将无法找到.pdb供您参考
If that doesn't help you can try to rebuild your external library using debug mode, then copy manually both .dll and the .pdb file to the bin of your app. 如果那没有帮助,您可以尝试使用调试模式重建外部库,然后将.dll和.pdb文件手动复制到应用程序的bin中。
While debugging, check in Debug/Modules, if your dll symbols are loaded. 调试时,如果已加载dll符号,则签入“调试/模块”。 If not, let them load.
如果没有,则让它们加载。 You may be asked to set the folder with pdb files.
可能会要求您设置带有pdb文件的文件夹。 Pdb contains the symbol used for debugging.
Pdb包含用于调试的符号。 It has to be the same version as dll file you are using in your projects.
它必须与项目中使用的dll文件的版本相同。 After that you will be able to debug the library.
之后,您将能够调试该库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.