简体   繁体   English

.Net:无法从程序集“IBM.XMS.Client.WMQ,版本=8.0.0.7”加载类型“IBM.WMQ.ManagedCommonServices”

[英].Net : Could not load type 'IBM.WMQ.ManagedCommonServices' from assembly 'IBM.XMS.Client.WMQ, Version=8.0.0.7

Using a .net framework Web API project we want to create a listener(consumer) for our MQ queue.我们希望使用 .net 框架 Web API 项目为我们的 MQ 队列创建一个侦听器(消费者)。 We are using XMS.Net as we are interested in asynchronous style of receiving messages.我们正在使用 XMS.Net,因为我们对接收消息的异步方式感兴趣。 However, while creating a connection we are getting error:但是,在创建连接时出现错误:

Could not load type 'IBM.WMQ.ManagedCommonServices' from assembly 'IBM.XMS.Client.WMQ, Version=8.0.0.7, Culture=neutral, PublicKeyToken=d2666ab12fca862b'.无法从程序集“IBM.XMS.Client.WMQ,Version=8.0.0.7,Culture=neutral,PublicKeyToken=d2666ab12fca862b”加载类型“IBM.WMQ.ManagedCommonServices”。

在此处输入图像描述

As per http://www-01.ibm.com/support/docview.wss?uid=swg1IC89514 this issue is fixed but we are still facing it using version 8.0.0.7.根据http://www-01.ibm.com/support/docview.wss?uid=swg1IC89514 ,此问题已解决,但我们仍面临使用版本 8.0.0.7 的问题。

This is working fine for.Net framework console application but with Web API project it is failing.这对于 .Net 框架控制台应用程序工作正常,但对于 Web API 项目它失败了。

As workaround we also tried adding following in app.config for Web API but no luck -作为解决方法,我们还尝试在 Web API 的 app.config 中添加以下内容,但没有成功 -

<appSettings> <add key="MQCSCLASS" value="amqmdnet(IBM.WMQ.ManagedCommonServices)"/> </appSettings>

Note: The MQ client is not installed on my machine.注意:我的机器上没有安装 MQ 客户端。 We have referred - amqmdmsg, amqmdnet, amqmdnm, amqmdnsp, amqmdxcs dlls into the project.我们已将 amqmdmsg、amqmdnet、amqmdnm、amqmdnsp、amqmdxcs dll 引用到项目中。

If you are using MQ v9.1, you can try the following steps如果您使用的是 MQ v9.1,您可以尝试以下步骤

1) SET the following variable in the environment DEVPATH=&RedistributablePackagePath&\bin 1)在环境DEVPATH=&RedistributablePackagePath&\bin中设置如下变量在此处输入图像描述

2) Add binding redirect tag to the App.config file of the application as the application was compiled using a lower MQ version and it has to be run against a higher version. 2) 将绑定重定向标记添加到应用程序的 App.config 文件中,因为应用程序是使用较低的 MQ 版本编译的,并且必须针对较高版本运行。 For this you can copy the content of NonPrimaryRedirect.config file located at "&MQInstallPath&\Tools\dotnet\samples\cs\base"为此,您可以复制位于“&MQInstallPath&\Tools\dotnet\samples\cs\base”的 NonPrimaryRedirect.config 文件的内容

Note: You have to modify the "newVersion" attribute value in the app.config file to the version you want to run against in your case it should be 9.1.0.0 and modify the "href" to the redistributable package path.注意:您必须将 app.config 文件中的“newVersion”属性值修改为您要运行的版本,在您的情况下它应该是 9.1.0.0,并将“href”修改为可再发行包路径。

3) Add the following tags into the app.config file 3)在app.config文件中添加如下标签

<runtime>
<developmentMode developerInstallation="true" />
</runtime>
<appSettings>
   <add key="MQCSCLASS"
value="amqmdnet(IBM.WMQ.ManagedCommonServices)"/>
 </appSettings>

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

相关问题 IBM.XMS.XMSC不包含WMQ_Client_Reconnect_Q_MGR的定义 - IBM.XMS.XMSC does not contain a definition for WMQ_Client_Reconnect_Q_MGR 使用用于 .net 的消息服务客户端连接到 IBM WMQ 时如何传递身份验证信息 - How to pass authentication info when using Messsage Service Client for .net to connect to IBM WMQ 如何处理来自 IBM WMQ 的 C# 中的 RFH2 标头? - How to handle the RFH2 header in C# from IBM WMQ? 我正在忙于编写C#IBM MQ Client应用程序,并不断收到“异常:&#39;IBM.WMQ.Nmqi.UnmanagedNmqiMQ&#39;的类型初始化程序引发了异常。” - I am busy writing a C# IBM MQ Client app and keep getting “Exception: The type initializer for 'IBM.WMQ.Nmqi.UnmanagedNmqiMQ' threw an exception.” 应该在.NET库中为IBM MQ WebSphere使用哪个命名空间(IBM.WMQ与IBM.WMQAX)(amqmdnet.dll) - Which namespace (IBM.WMQ vs. IBM.WMQAX) should be used in the .NET library for IBM MQ WebSphere (amqmdnet.dll) 使用 SSL 设置 .Net IBM.XMS 客户端到 KDPW - Setting up .Net IBM.XMS client with SSL to KDPW 尝试调试使用IBM WMQ(amqmdnet.dll)的VS2010 C#代码 - Trying to debug VS2010 C# code that uses IBM WMQ (amqmdnet.dll) .Net无法从程序集中加载类型 - .Net Could not load type from assembly 无法更改 IBM MQ XMS.NET 客户端重新连接超时 - IBM MQ XMS.NET client reconnect timeout can't be changed IBM MQ XMS.NET - 连接时出现 2059 错误 - IBM MQ XMS.NET - 2059 Error when connecting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM