使用 IBM MQ 为 .net 6 API 启动 swagger 时出现异常

问题描述 投票:0回答:1

我正在使用 IBM MQ nuget 包 IBMXMSDotnetClient 9.3.4.1 (XMS.net)。 Visual Studio 2022 和 .Net 6。

在 IIS 中启动 swagger 我收到以下错误 -

物理根为“C:\inetpub\wwwroot.Project.API”的应用程序“/LM/W3SVC/6/ROOT”遇到意外的托管异常,异常代码 =“0xe0434352”。捕获的 stdout 和 stderr 日志的前 30KB 字符: “dspmqver”未被识别为内部或外部命令, 可运行的程序或批处理文件。 未处理的异常。

System.IO.FileNotFoundException: Error reading the  directory.
   at System.IO.FileSystemWatcher.StartRaisingEvents()
   at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
   at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
at IBM.WMQ.MQClientCfg.CheckForMqclientIniFileChanges()
   at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
   at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
   at IBM.XMS.Client.WMQ.Common.WmqPropertyHandler..ctor()
 at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.InitialiseWMQConnectionFactory()
   at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory..ctor(XmsPropertyContext props)
   at IBM.XMS.Client.WMQ.Factories.WmqFactoryFactory.CreateProviderConnectionFactory(XmsPropertyContext properties)
   at IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.SetProviderFactory()
   at IBM.XMS.Admin.Objects.MQConnectionFactory..ctor()
at IBM.XMS.Admin.Objects.WmqXmsFactory.CreateConnectionFactory()
   at IBM.XMS.Client.Impl.XmsFactoryFactoryImpl.CreateConnectionFactory()

应用程序池设置为运行时 - 无托管代码

我重置了 IIS 并浏览,仍然遇到相同的错误 - mcclient.ini 是什么?这里预计什么位置?

任何帮助表示赞赏。

我没有使用任何 MQClient.ini,因为应用程序不需要它。 “dspmqver”是可访问的,我可以运行 “C:> dir /b /s C:\setmqenv.cmd” 和 “C:> dir /b /s C:\dspmqver.exe”给出了预期的结果。

我的应用程序在 Visual Studio 2022 中作为控制台应用程序运行良好 IBM MQ 客户端 9.3.5 mqclient.ini 由安装程序创建,位于 C:\Program Files\IBM\MQ\samp\mqclient.ini

此外,我已授予 IUSR 和应用程序用户完全访问权限。

iis swagger .net-6.0 ibm-mq
1个回答
0
投票

此错误可能与 IBM MQ nuget 包的位数有关。您可以尝试在iis中设置启用32位应用程序来解决问题。

转到网站>选择您的32位应用程序将在其下运行的应用程序池>单击高级设置>将启用32位应用程序设置为True。

© www.soinside.com 2019 - 2024. All rights reserved.