简体   繁体   English

在Visual Studio中调试引用的DLL

[英]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.

相关问题 Visual Studio:调试引用的DLL,我在另一个SLN中有源代码 - Visual Studio: Debugging a referenced DLL, I have source in another SLN 找不到引用的Nuget DLL,可以在Visual Studio中正常工作 - Referenced Nuget DLL Not Found Working Visual Studio 防止 Visual Studio 复制引用的 dll - Prevent Visual Studio from duplicating referenced dll 在Visual Studio中调试第三方DLL? - Debugging a third-party DLL in Visual Studio? 如何从Visual Studio 2012调试引用的dll - How can I debug a referenced dll from Visual Studio 2012 调试Visual Studio宏中引用的自定义dll - Debug custom dll that is being referenced in visual studio macro Visual Studio 找不到我引用的 DLL 的命名空间 - Visual studio cannot find my referenced DLL's namespace Visual Studio远程调试 - 缺少MSVCP140.dll - Visual Studio Remote Debugging - MSVCP140.dll is missing Microsoft Visual Studio:一次调试多个项目(可执行文件访问DLL中的函数+可执行文件使用的DLL) - Microsoft Visual Studio: Debugging multiple projects at once (executable that accesses functions in DLL + the DLL used by executable) 如何使用您在Visual Studio C#.Net中引用的项目的dll? - How to use dll of the project you referenced in Visual Studio C# .Net?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM