0

I got a web deyploment project for a web application project in vs 2008. While building the web deployment project, I want to replace properties in the web.config.

My settings are autogenrated by the deisgner.

<applicationSettings>
 <NAMESPACE.Properties.Settings>
   <setting name="Testenvironment" serializeAs="String">
    <value>True</value>
   </setting>

  </NAMESPACE.Properties.Settings>
</applicationSettings>

In the config file which contains the settings for the specific server looks like the following:

<?xml version="1.0"?>
<applicationSettings>
    <NAMESPACE.Properties.Settings>
       <setting name="Testenvironment" serializeAs="String">
        <value>False</value>
       </setting>
    </NAMESPACE.Properties.Settings>
</applicationSettings>

残念ながら、これは機能しません。「configSource ファイルの形式は、セクションの名前を含む要素である必要があります」というエラーが表示され、2 行目 (2 番目のコード例) が強調表示されます。

すべてを機能させるには、タグにどのように名前を付ける必要がありますか?

編集:「applicationSetting」タグの削除も機能しません。

4

1 に答える 1

0

問題/解決策が見つかりました:

Web展開プロジェクトで私は言った

appSettings=FILENAME.config

それよりも

applicationSettings/NAMESPACE.Properties.Settings=FILENAME.config

今は正常に動作します

于 2010-03-09T10:33:35.947 に答える