0

Visual Studio 2012 を使用していますが、差分環境に web.config ファイルを追加するのが難しいと感じています。このリンクを見て、 .pubxmlファイルを右クリックして、構成変換オプションの追加を選択してみました。これを行った後、システムは、ビジュアルスタジオを使用して名前を変更できないweb.simplePublish.config ファイルを追加します。

ここに画像の説明を入力

Windows エクスプローラーを使用してファイルの名前を変更すると、ファイルはソリューションの web.config ツリーに表示されません。

ここに画像の説明を入力

Visual Studio 2012 でさまざまな環境に web.config ファイルを追加する正しい方法は何ですか?

4

2 に答える 2

0

Visual Studio のSlowCheetah - XML Transforms プラグインを使用して、差分環境用の web.config ファイルを作成しました。

于 2014-04-21T12:25:08.950 に答える
0

*.csproj を変更してから、名前を変更する前にファイル名を見つけ、Windows エクスプローラーを使用してファイル名を修正することができます。または、新しいタグを *.csproj に追加してみてください。

  <ItemGroup>
<Content Include="..\default.licenseheader">
  <Link>default.licenseheader</Link>
</Content>
<Content Include="packages.config" />
<None Include="Properties\PublishProfiles\xxxx.pubxml" />
<None Include="Web.Debug.config">
  <DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
  <DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.SimplePublish.config">
  <DependentUpon>Web.config</DependentUpon>
</None>

ビジュアル スタジオで Configuration Manager を使用する別の方法については、次のリンクを参照してください

于 2014-04-16T09:32:31.970 に答える