简体   繁体   English

尝试调试使用IBM WMQ(amqmdnet.dll)的VS2010 C#代码

[英]Trying to debug VS2010 C# code that uses IBM WMQ (amqmdnet.dll)

I'm using IMB WMQ library to connect to a queue manager. 我正在使用IMB WMQ库连接到队列管理器。

This is a code I use for a long time, it was created by a friend in VS2005 and I updated to be used in VS2010. 这是我使用了很长时间的代码,它是由朋友在VS2005中创建的,我已更新为在VS2010中使用。 It works fine when I use integrated with LoadRunner tool to run some performance scripts. 当我使用与LoadRunner工具集成来运行一些性能脚本时,它可以正常工作。 However when I try to debug it returns the following error: 但是,当我尝试调试时,它返回以下错误:

{"Unable to load DLL '**amqxcs2.dll**': The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))"}

This is something related to debugging external DLL, but I didn't find out how to resolve. 这与调试外部DLL有关,但是我没有找到解决方法。

I used the following command to register the dll into GAC: 我使用以下命令将dll注册到GAC:

gacutil /I "C:\Program Files\IBM\WebSphere MQ\bin\amqmdnet.dll"

When I tried to add amqxcs2.dll it returns an error: 当我尝试添加amqxcs2.dll时,它返回错误:

gacutil /I "C:\Program Files\IBM\WebSphere MQ\bin\amqxcs2.dll"
Failure adding assembly to the cache:   The module was expected
to contain an assembly manifest.

I have VS2010 Ultimate running on a Windows Server 2003. 我在Windows Server 2003上运行了VS2010 Ultimate。

When running the code inside Loadrunner I'm able to put and get messages from the queues, but I'm not able to debug. 在Loadrunner中运行代码时,我可以从队列中放入消息并从中获取消息,但无法调试。

There's a similar post here , but it doesn't have a solution. 这里也有类似的帖子 ,但是没有解决方案。

Why do you think "make sure the library is either where the application needs it to be" is not a solution? 您为什么认为“确保库位于应用程序所需的位置”不是解决方案?

You need to either properly install whatever product your are using on the machine you plan to use it or cheat your way through by copying necessary files to correct places by hand (and figuring "correct places" by hand too. SysInternals tools may be helpful to track what files an application tries to use). 您需要在打算使用的计算机上正确安装正在使用的任何产品,或者通过手工复制必要的文件来纠正位置(并手动确定“正确的位置”)来欺骗自己的方式。SysInternals工具可能对跟踪应用程序尝试使用的文件)。

This may be a COM error. 这可能是COM错误。 The IBM assembly is probably a native dll and so you cannot register it in the GAC, which is for .NET dlls only. IBM程序集可能是本机dll,因此您不能在GAC中注册它,该GAC仅适用于.NET dll。 Native COM dlls can be registered with Regsvr32 . 可以使用Regsvr32注册本机COM dll。 This error can also occur if a native dll has a dependency on another dll that is missing. 如果本机dll对另一个缺少的dll有依赖关系,也会发生此错误。 Also see Understanding Dependencies of a Visual C++ Application which gives information about the Dependency Walker tool that can be used to figure out the depndencies for a native dll. 另请参阅了解Visual C ++应用程序的依赖关系,它提供了有关Dependency Walker工具的信息,该工具可用于计算本机dll的依赖关系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM