.NET COBOL の構成ファイルの形式

実行時の動作を構成するために必要なオプションを IDE で使用できない場合は、.config ファイルを使用して .NET COBOL アプリケーションで実行時チューナーを設定します。

Visual Studio では、使用しているアプリケーションの種類に適した次のような .config ファイルを追加します。
  • コンソール アプリケーションには、アプリケーション構成ファイル (exe.config) を追加します。
  • ASP.NET アプリケーションには、Web 構成ファイル (web.config) を追加します。
注: このファイルは実行時に管理されるアプリケーションの一部であるため、このファイルをポイントするように COBCONFIG_ 環境変数を構成する必要はありません。

.NET COBOL アプリケーションに構成を追加すれば、Tunables セクション グループはすでに宣言された状態になっています。次の太字のセクションの詳細を参考に、セクションの詳細を追加します。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <configSections>
  <sectionGroup name="MicroFocus.COBOL.Application">
   <section name="Switches" type="System.Configuration.NameValueSectionHandler" />
   <section name="Environment" type="System.Configuration.NameValueSectionHandler" />
   <sectionGroup name="Interop">
    <section name="PreLoad" type="System.Configuration.NameValueSectionHandler" /> 
   </sectionGroup>
  </sectionGroup>

  <sectionGroup name="MicroFocus.COBOL.Runtime">
   <section name="Tunables" type="System.Configuration.NameValueSectionHandler" />
   <section name="Switches" type="System.Configuration.NameValueSectionHandler" />
  </sectionGroup>
</configSections>

<MicroFocus.COBOL.Application>
 <Switches></Switches>
 <Environment></Environment>
 <Interop> <PreLoad> </PreLoad> </Interop>
</MicroFocus.COBOL.Application>

 <MicroFocus.COBOL.Runtime>
  <Tunables>
   <add key="printer_redirection" value="true" /> 
   <add key="printer_defaults" value="size=20;font=Courier New" /> 
  </Tunables>
  <Switches></Switches>
 </MicroFocus.COBOL.Runtime>
</configuration>