从AutoSys运行.NET应用程序时出错

从AutoSys运行.NET应用程序时出错,.net,ibm-mq,autosys,.net,Ibm Mq,Autosys,我有一个.NET控制台应用程序,它运行在安装了AutoSys和WebSphere MQ的Windows Server 2008上(该应用程序用于向WebSphere MQ发送消息) 我正在尝试设置一个AutoSys作业,它将每10分钟调用一次控制台应用程序 如果我登录到服务器并使用命令行运行应用程序,应用程序将正常工作 但如果使用AutoSys运行应用程序,则会出现以下错误: The type initializer for 'IBM.WMQ.MQQueueManager' threw an e

我有一个.NET控制台应用程序,它运行在安装了AutoSys和WebSphere MQ的Windows Server 2008上(该应用程序用于向WebSphere MQ发送消息)

我正在尝试设置一个AutoSys作业,它将每10分钟调用一次控制台应用程序

如果我登录到服务器并使用命令行运行应用程序,应用程序将正常工作

但如果使用AutoSys运行应用程序,则会出现以下错误:

The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.

StackTrace =    at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
   at SendMessage.QueueJobExecutionItem.ExecuteQueueJob(QueueInfo queueInfo, CrmInfo crmInfo, LogFileInfo logFileInfo, List`1 entityList) in C:\SendMessage\QueueJobExecutionItem.cs:line 36
   at SendMessage.Program.StartLoad() in C:\SendMessage\Program.cs:line 75
   at SendMessage.Program.Main(String[] args) in C:\SendMessage\Program.cs:line 111

Error Message InnerException = The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.

InnerException StackTrace =    at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
   at SendMessage.QueueJobExecutionItem.ExecuteQueueJob(QueueInfo queueInfo, CrmInfo crmInfo, LogFileInfo logFileInfo, List`1 entityList) in C:\SendMessage\QueueJobExecutionItem.cs:line 36
   at SendMessage.Program.StartLoad() in C:\SendMessage\Program.cs:line 75
   at SendMessage.Program.Main(String[] args) in C:\SendMessage\Program.cs:line 111

InnerException Source = amqmdnet

Error Message InnerException = Exception has been thrown by the target of an invocation.

InnerException StackTrace =    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at IBM.WMQ.CommonServices.CreateCommonServices()
   at IBM.WMQ.CommonServices.TraceConstructor(String objectId, String sccsid)
   at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
   at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
   at IBM.WMQ.MQQueueManager..cctor()

InnerException Source = mscorlib

Error Message InnerException = An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

InnerException StackTrace =    at IBM.WMQ.MQCommonServices.xcsInitialize(UInt16 scope, UInt16 attributes, Byte[] charName, Byte[] charPrefix, xcsHPOOL& hPool)
   at IBM.WMQ.MQCommonServices.Initialize()

InnerException Source = amqmdxcs
我在登录服务器并运行AutoSys时使用的是同一个用户,因此我希望应用程序以相同的方式运行

我想知道以前是否有人遇到过这个问题,或者AutoSys中是否缺少任何配置/参数等,这些配置/参数会使应用程序以与登录服务器时相同的方式工作

我希望这是有意义的


提前感谢异常显示
试图加载格式不正确的程序。
并指向
amqmdxcs.dll
这可能是因为您的应用程序是64位的,但它正在尝试加载32位版本的WMQ库,或者您的应用程序是32位的,但正在尝试加载64位版本WMQ库的名称。您需要检查AutoSys的位并设置加载相应WMQ库的路径。

能否粘贴整个异常堆栈?@Shashi:我刚刚添加了整个异常堆栈谢谢@Shahi。我对Autosys很陌生,所以你知道我如何更改bittage吗?不知道。我对Autosys了解不多。我通过重新启动服务器解决了这个问题。看起来,当我们安装WMQ时,我们从未重新启动过服务器