単一の web.config を保持することで、特定のフォルダー内の Web ページの設定を構成できます。web.config.debugとweb.config.releaseとweb.configを見たのと同じ階層に複数の web.config がありますか。それらが意図されている理由。
1 に答える
2
これらはweb.config 変換であり、プロジェクトのさまざまなビルド (デバッグ、開発、リリースなど) に変更を適用できます。
.debug
、などの接尾辞が付いているもの.release
は、変換ファイルです。ベースを取得し、web.config
指定した XML-Document-Transform 属性を使用してそれを変更します。
典型的な使用例は、debug=true
本番環境では絶対に使用したくない属性です。簡単な変換を使用して、web.config.release
ファイルから削除できます。
Web.config
<configuration>
<compilation debug="true" />
</configuration>
Web.config.release
<configuration>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</configuration>
于 2012-11-06T07:59:21.463 に答える