1

私はマルチレイヤーのソリューションであるWebフォームアプリケーションを扱います。すべてのWebServicesは、WSと呼ばれるプロジェクトの下にあります。百以上のものがあります。そしてWeb FormsプロジェクトからWSを呼び出します。Web.Debug.configファイルのonanother dllであるwebserviceアドレスをオーバーライドします。

私は、DebugコンフィグレーションとLiveシステムの下でテストサービスをリリースコンフィグレーションで使用したいと考えています。 WSライブラリプロジェクトの

のapp.configは

<applicationSettings> 
    <WS.Properties.Settings> 
    <setting name="settingName" 
     serializeAs="String"> 
     <value>http://test.x.com/a.asmx</value> 
    </setting> 
    </WS.Properties.Settings> 
</applicationSettings> 

ですだから私はそれが生きてサービスを開始できweb.configファイルにこれらの行

<configSections> 
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 

    ...... 

    <section name="WS.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </sectionGroup> 
</configSections> 



<applicationSettings> 
    <WS.Properties.Settings> 
    <setting name="settingName" 
     serializeAs="String"> 
     <value>http://live.x.com/a.asmx</value> 
    </setting> 
    </WS.Properties.Settings> 
</applicationSettings> 

を追加しました。

(web.debug.config)私はいくつかの変換を試みました。しかし、プログラムはweb.debugの設定に接続しています(ライブサービスを起動します)。

<applicationSettings> 
    <WS.Properties.Settings xdt:Transform="Replace" xdt:Locator="Match(name)"> 
    <setting name="settingName" 
     serializeAs="String"> 
     <value>http://test.x.com/a.asmx</value> 
    </setting> 
</WS.Properties.Settings> 
</applicationSettings> 

テストサービスをデバッグ構成に接続するには、web.debug.configファイルをどのように変更する必要がありますか。

ありがとう、

答えて

0

この選択は、[デバッグを公開しない]セクションにのみ影響します。私はそれを見つけましたが、答えに時間を共有することができませんでした。

#if DEBUG 
.... 
#endif 
のようないくつかのプリプロセッサを使用することをお勧めし解決策になることができます
関連する問題