0

I am using visual studio 2012 and I am finding it difficult to add web.config files for diff environment. I looked at this link and tried right clicking on .pubxml file and choose add config transform option. After I do this, system adds web.simplePublish.config file which I am not able to rename using visual studio.

enter image description here

If I rename the file using windows explorer, the file is not listed under web.config tree in the solution.

enter image description here

What is the right way to add web.config files for various environments in Visual Studio 2012.

Community
  • 1
  • 1
SharpCoder
  • 18,279
  • 43
  • 153
  • 249

2 Answers2

0

you can try to modify the *.csproj then find out the filename before you rename it and to revise the filename that you using windows explorer. or you can just try to add a new tag into *.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>

The other way that you can use Configuration Manager at your visual studio please refer the following link Add an Additional

Aggis Wu
  • 99
  • 1
  • 10
  • Thank you for quick reply. But this sounds more like a work around. There must a straight forward way. Let me wait for few more replies. – SharpCoder Apr 16 '14 at 10:04
  • @Brown_Dynamite I have already update the answer and provide you another way to reach your requirement. – Aggis Wu Apr 16 '14 at 11:33
0

I used SlowCheetah - XML Transforms plugin of visual studio to create web.config files for diff environment.

SharpCoder
  • 18,279
  • 43
  • 153
  • 249