无法加载DLL'mqrt.dll' [英] Unable to load DLL 'mqrt.dll'
问题描述
我在SERVER1上有客户端应用程序,MSMQ和SERVER2上的WCF服务。
当SERVER1 / ClientApp尝试将消息推送到SERVER2 MSMQ时,我收到以下错误:
System.TypeInitializationException:'System.ServiceModel.Channels.Msmq'的类型初始化程序抛出异常。 ---> System.DllNotFoundException:无法加载DLL'mqrt.dll':找不到指定的模块。 (HRESULT的异常:0x8007007E)
在System.ServiceModel.Channels.UnsafeNativeMethods.MQGetPrivateComputerInformation(String computerName,IntPtr属性)
在System.ServiceModel.Channels.MsmqQueue.GetMsmqInformation(版本&版本,布尔& activeDirectoryEnabled )
在System.ServiceModel.Channels.Msmq..cctor()
---内部异常堆栈跟踪结束---
在System.ServiceModel.Channels.Msmq.EnterXPSendLock(Boolean& amp ; lockHeld,ProtectionLevel protectionLevel)
在System.ServiceModel.Channels.MsmqOutputChannel.OnSend(消息消息,TimeSpan超时)
在System.ServiceModel.Channels.OutputChannel.Send(消息消息,TimeSpan超时)
在System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime操作,Object [] ins,Object []outs,TimeSpan timeout)
在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService IMetho dCallMessage methodCall,ProxyOperationRuntime操作)
在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage消息)
异常在[7]上重新抛出:
在System.Runtime.Remoting。 Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32类型)
在FacilityManager.Service.NotificationsProcessorServiceReference.INotificationsProcessor.SendNewReactiveTaskNotifications(NewReactiveTaskDataContract newReactiveTaskDataContract)
SERVER1和SERVER2都运行Windows Server 2008 R2 Enterprise(6.1 SP1),并且都通过服务器管理器中的添加功能安装了MSMQ。
我明白DLL缺少(从错误中显而易见的),但我不知道我应该安装什么来获取它应该在哪里。
搜索在Windows资源管理器中显示该DLL存在于两台服务器上的以下目录中。
- C:\Windows\System32 C:\Windows \SysWOW64
- C:\Windows\winsxs\x86_microsoft-windows-msmq-runtime-core_31bf3856ad364e35_6。 1.7601.17514_none_5768e2ad17453bd6
- C:\Windows\winsxs\amd64_microsof t-windows-msmq-runtime-core_31bf3856ad364e35_6.1.7601.17514_none_b3877e30cfa2ad0c
任何帮助赞赏。
我没有更聪明,但事情现在正在工作。
最后只是通过编写一个快速控制台应用程序来检查MSMQ是否安装在这两个服务器上,代码从这里获取...
https://stackoverflow.com/a/16104212/192999
我在两个控制台应用程序上运行Server1和Server2都返回,结果是True到IsMsmqInstalled。
然后我运行我的应用程序,无法加载DLLmqrt.dll错误是不再被提起。
我不知道调用 NativeMethods.LoadLibrary(Mqrt.dll);
注册DLL或其他东西,但它肯定解决了我的问题。
我希望这将有助于未来!
I've developed a WCF Service which is hosted as a Windows Service and exposes a MSMQ endpoint.
I have the client app on SERVER1, and the MSMQ and WCF Service on SERVER2.
When the SERVER1/ClientApp attempts to push a message on to the SERVER2 MSMQ, I get the following errror:
System.TypeInitializationException: The type initializer for 'System.ServiceModel.Channels.Msmq' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'mqrt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.ServiceModel.Channels.UnsafeNativeMethods.MQGetPrivateComputerInformation(String computerName, IntPtr properties)
at System.ServiceModel.Channels.MsmqQueue.GetMsmqInformation(Version& version, Boolean& activeDirectoryEnabled)
at System.ServiceModel.Channels.Msmq..cctor()
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.Msmq.EnterXPSendLock(Boolean& lockHeld, ProtectionLevel protectionLevel)
at System.ServiceModel.Channels.MsmqOutputChannel.OnSend(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.OutputChannel.Send(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [7]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at FacilityManager.Service.NotificationsProcessorServiceReference.INotificationsProcessor.SendNewReactiveTaskNotifications(NewReactiveTaskDataContract newReactiveTaskDataContract)
Both SERVER1 and SERVER2 are running Windows Server 2008 R2 Enterprise (6.1 SP1), and both have had MSMQ installed via the Add Features in Server Manager.
I understand that the DLL is missing (fairly obvious from the error!), but I've no idea what I should be installing to get the dll where it should be.
A search in Windows Explorer shows that the DLL is present in the following directories on both servers....
- C:\Windows\System32
- C:\Windows\SysWOW64
- C:\Windows\winsxs\x86_microsoft-windows-msmq-runtime-core_31bf3856ad364e35_6.1.7601.17514_none_5768e2ad17453bd6
- C:\Windows\winsxs\amd64_microsoft-windows-msmq-runtime-core_31bf3856ad364e35_6.1.7601.17514_none_b3877e30cfa2ad0c
Any help appreciated.
I'm none the wiser but things are working now.
After hours on SO and Google, I ended up just checking that MSMQ was installed on both Servers by writing a quick console application with the code grabbed from here...
https://stackoverflow.com/a/16104212/192999
I ran the console app on both Server1 and Server2 and both came back with a result of True to IsMsmqInstalled.
I then ran my application and the "Unable to load DLL 'mqrt.dll'" error was no longer being raised.
I don't know if the call to NativeMethods.LoadLibrary("Mqrt.dll");
registered the DLL or something, but it certainly fixed my problem.
I hope this helps someone in the future!
这篇关于无法加载DLL'mqrt.dll'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!