MSMQ无法与.net framework 4.5交叉服务器(MSMQ doesn't work cross-server with .net framework 4.5)
安装VS2012后,尝试使用多年未有意义修改的古老应用程序,MSMQ消息正在丢失。
研究证明它们正在目标服务器上处理,但由于响应队列不正确而未正确返回。 它使用的是PRIVATE:格式,而不是传递给构造函数的DIRECT:OS:格式。
具体来说,这是执行:
Dim lobj_Queue As New MessageQueue("FormatName:DIRECT=OS:" & astrServer & "\" & astrQueue)
其中astrServer是我本地计算机的名称, astrQueue是我希望响应放入的响应队列的名称。
生成的队列格式名称为"PRIVATE=d69f93e2-18f1-42eb-a468-84ca521efb5b\00000298" ,这对于跨林活动是不可翻译的。
运行为.net framework 3.5构建的相同应用程序正常运行。
调试MessageQueue.FormatName属性的源显示当前,处理抛出的异常,并且它回退到解析队列路径的先前方法。 这将首次为目标服务器生成有效的队列路径,因此消息将到达服务器并进行处理,但是在本地计算机上生成响应队列时,调用会成功并生成目标无法理解的格式名称。服务器,因此永远不会收到服务器的响应,并永远保留在传出队列中。
有没有办法继续做这项工作? 据我所知,没有办法使用私有响应队列,因为您在本地生成的任何名称只能在同一个林中理解。
我希望有一些我缺少的东西,有一个明显的解决方案可以做到这一点,因为这个特定场景完全没有答案。
After installing VS2012, and attempting to use an ancient app that hasn't been modified meaningfully in years, MSMQ messages were being lost.
Research proved that they were being processed on the target server, but not returned correctly because the Response queue was incorrect. It was using a PRIVATE: format instead of the DIRECT:OS: format that was passed in to the constructor.
Specifically, this is executed:
Dim lobj_Queue As New MessageQueue("FormatName:DIRECT=OS:" & astrServer & "\" & astrQueue)
where astrServer is the name of my local machine and astrQueue is the name of the response queue that I want the response placed into.
The resulting format name of the queue is "PRIVATE=d69f93e2-18f1-42eb-a468-84ca521efb5b\00000298" which is not translatable for cross-forest activity.
Running the same app built for .net framework 3.5 worked properly.
Debugging into the source of the MessageQueue.FormatName property shows that currently, the exception that is thrown is handled, and it falls back to the previous method of parsing the queue path. This generates a valid queue path the first time for the target server, so the message gets to the server and is processed, however when generating the response queue on the local machine, the call succeeds and generates a format name that is incomprehensible to the target server, so the server's response is never received, and remains in outgoing queues eternally.
Is there any way to continue to make this work? As far as I can see, there is no way to use a private response queue because any name you generate locally will be only be understandable on the same forest.
I am hoping there is something I am missing, that there is an obvious solution to do this given the complete lack of answers for this specific scenario.
原文:https://stackoverflow.com/questions/15774849
更新时间:2020-02-15 12:43
最满意答案
在处理了一段时间的低效解决方法之后,我们的一位同事找到了解决问题的方法:
在客户端计算机上,您需要卸载“ Message Queuing和Message Queuing Services下的“ Directory Services Integration功能。
然后,请求可以正确地路由回发送方。 我不确定这个功能是由.NET 4.5自动添加还是仅由它修改,但是禁用它会立即解决问题(正在运行的Web应用程序甚至没有重启 - 下一个请求刚刚起作用)
After dealing with inefficient workarounds for awhile, one of our coworkers found the fix to the issue:
On the client computer, you need to uninstall the Directory Services Integration feature, which is under Message Queuing and Message Queuing Services.
Then requests are able to be routed back to the sender properly. I'm not sure if this feature was added automatically by .NET 4.5 or simply modified by it, but disabling it instantly fixed the problem (The running web application didn't even restart - the next request just worked)
相关问答
Visual Studio 2010之前的每个版本的Visual Studio与特定的.NET框架相关联。 (VS2008是.NET 3.5,VS2005是.NET 2.0,VS2003是.NET1.1)Visual Studio 2010及更高版本允许对先前的框架版本进行定位,但不能用于将来的版本。 您必须使用Visual Studio 2012才能使用.NET 4.5。 Each version of Visual Studio prior to Visual Studio 2010 is t
...
这不应该对程序的功能产生影响,因为.NET 4.5只是4.0的更新。 看这里 如何在IIS 7应用程序池中设置.net Framework 4.5版本 This shouldn't make a difference in the functionality of your program, as .NET 4.5 is just an update for 4.0. See here How to set .net Framework 4.5 version in IIS 7 applicati
...
.NET 4.5是4.0的替代品 - 您将在4.0目录中找到程序集。 参见Rick Strahl和Scott Hanselman关于这个话题的博客。 您还可以在以下位置找到特定版本: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework
.NET 4.5 is an in place replacement for 4.0 - you will find the assemblies in th
...
是的,.NET 4.0程序集将在.NET 4.5项目中运行。 4.5 CLR是CLR的新版本,但向后兼容4.0。 请参阅这篇StackOverflow 问题以及来自Scott Hanselman的博客文章 。 因此,如果您有一个类项目设置为目标.NET 4.5并添加.NET 4.0版本的FluentMigrator作为参考(或安装Nuget包),那么它将正常工作。 对于FluentMigrator而言,由于必须支持.NET 3.5,因此使用.NET 4.5软件包没有什么好处,因此尚无法使用任何新的
...
Visual Studio 2010没有.NET框架版本4.5。 您必须使用Visual Studio 2012才能支持.NET 4.5。 Visual Studio 2010 has not .NET framework versions 4.5. You must use Visual Studio 2012 in order to support .NET 4.5.
在脚本任务/组件中保存更改是一个三步过程:Build / Save / Ok。 1.)在VSTA中,更改.NET框架,然后构建解决方案。 2.)保存解决方案并关闭VSTA。 3.)当您回到脚本转换编辑器时,单击确定。 如果您点击取消,所有的更改都将被取消,您将不得不重做一切。 Saving changes in script tasks/components is a three step process: Build/Save/Ok. 1.) In VSTA, change the .NET f
...
您需要在引导程序“bundle.wxs”中执行以下操作 1. ref NetFxExtension.dll,可以在Wix SDK文件夹中找到 2.创建Util以查看用户是否具有.net45 3. Net 4.5下载链接 我为我的一个项目做了类似的事情,下面是我的bundle.wxs供你参考 <?xml version="1.0" encoding="UTF-8"?>
...
在处理了一段时间的低效解决方法之后,我们的一位同事找到了解决问题的方法: 在客户端计算机上,您需要卸载“ Message Queuing和Message Queuing Services下的“ Directory Services Integration功能。 然后,请求可以正确地路由回发送方。 我不确定这个功能是由.NET 4.5自动添加还是仅由它修改,但是禁用它会立即解决问题(正在运行的Web应用程序甚至没有重启 - 下一个请求刚刚起作用) After dealing with ineffic
...
我认为构建警告很好地描述了将要发生的事情。 我用两个项目创建了一个解决方案: ProjectA(框架版本4.0) ProjectB(框架版本4.5) ProjectA引用了ProjectB。 警告: The referenced project 'ProjectB' is targeting a higher framework version (4.5) than this project’s current target framework version (4.0). This may le
...
从MVC 4 (Emphasis mine)的下载页面 PowerShell 2.0, .NET 4,ASP.NET 4和Visual Studio 2010 SP1或Visual Web Developer 2010 SP1是使用此功能所必需的。 即仅需要.Net Framework 4.0版,而不是4.5。 From the download page for MVC 4 (Emphasis mine) PowerShell 2.0, .NET 4, ASP.NET 4, and Visual
...