如何使用CCDT文件连接队列管理器(2063错误)。在app.config文件中添加ChannelDefinitionDirectory

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

初始化时获取错误代码2063

MqQueueManager = new MQQueueManager(_queueManagerName, props);

App.config更改:

<section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" />
 <CHANNELS>
    <add key="ChannelDefinitionDirectory" value="C:\filepath\path" />
    <add key="ChannelDefinitionFile" value="ccdtfile.ccdt.TAB" />
  </CHANNELS>

代码更改:

  Hashtable props = new Hashtable();
                props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
                Console.WriteLine(_queueManagerName);
                MqQueueManager = new MQQueueManager(_queueManagerName, props);
c# websphere mq
1个回答
0
投票

我认为错误可能与app.config文件的格式有关。我使用了以下内容并且能够连接:请注意,configSections必须是configuration部分下的第一个元素。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="CHANNELS" type="System.Configuration.NameValueSectionHandler" />
  </configSections>
  <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
  <CHANNELS>
    <add key="ChannelDefinitionDirectory" value="C:\ProgramData\IBM\MQ\qmgrs\MFTQM\@ipcc" />
    <add key="ChannelDefinitionFile" value="AMQCLCHL.TAB" />
  </CHANNELS>

</configuration>
© www.soinside.com 2019 - 2024. All rights reserved.