在.NET中调试COM库(Visual Studio 2010)

时间:2021-12-27 02:51:39

I use a COM library (3rd party) with interop in a C# application. How can I debug objects of this library in VS2010? Or is this not possible?

我在C#应用程序中使用带有interop的COM库(第三方)。如何在VS2010中调试此库的对象?或者这不可能吗?

2 个解决方案

#1


4  

A similar question would be "how do I debug my operating system". You don't, you keep your fingers crossed that it will give you a decent error code and message when you use it improperly. Even if you do find a bug in the library, there's nothing you can do about it unless you have the source code and the right to rebuild it.

类似的问题是“如何调试我的操作系统”。你没有,你保持手指交叉,当你不正确地使用它时,它会给你一个像样的错误代码和消息。即使您确实在库中发现了一个错误,除非您拥有源代码和重建它的权限,否则您无能为力。

Review the license agreement you've got to use this library for support options.

查看您必须使用此库获取支持选项的许可协议。

#2


1  

To enable debugging of COM dlls you have to do the following:

要启用COM dll的调试,您必须执行以下操作:

Projects Settings of the .NET Project -> Debug -> "Enable unmanaged code debugging" has to be selected

必须选择.NET项目的项目设置 - >调试 - >“启用非托管代码调试”

Now you can attach an unmanaged debugger/debug into unmanaged dlls.

现在,您可以将非托管调试器/调试附加到非托管dll中。

To step into the source of the dll you need the appropriate pdb files and source files.

要进入dll的源代码,您需要相应的pdb文件和源文件。

#1


4  

A similar question would be "how do I debug my operating system". You don't, you keep your fingers crossed that it will give you a decent error code and message when you use it improperly. Even if you do find a bug in the library, there's nothing you can do about it unless you have the source code and the right to rebuild it.

类似的问题是“如何调试我的操作系统”。你没有,你保持手指交叉,当你不正确地使用它时,它会给你一个像样的错误代码和消息。即使您确实在库中发现了一个错误,除非您拥有源代码和重建它的权限,否则您无能为力。

Review the license agreement you've got to use this library for support options.

查看您必须使用此库获取支持选项的许可协议。

#2


1  

To enable debugging of COM dlls you have to do the following:

要启用COM dll的调试,您必须执行以下操作:

Projects Settings of the .NET Project -> Debug -> "Enable unmanaged code debugging" has to be selected

必须选择.NET项目的项目设置 - >调试 - >“启用非托管代码调试”

Now you can attach an unmanaged debugger/debug into unmanaged dlls.

现在,您可以将非托管调试器/调试附加到非托管dll中。

To step into the source of the dll you need the appropriate pdb files and source files.

要进入dll的源代码,您需要相应的pdb文件和源文件。