Question

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.

Was it helpful?

Solution 2

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top