My team and I are using VS2012 for a number of projects, and have developed a workflow with our QA and UAT group that involves 5 environments: Local, Development Staging, Testing, Preproduction, and Production. We've found ourselves having to create Local/Dev/Test/Preprod/Prod build configuration for every project and solution, and remove the debug and release configurations.
Is there any way to have VS create these environments by default on new projects instead of the debug/release configurations?
EDIT: I've not been able to find any Global option for this, as it seems the build configurations are all in the individual project folders.
What I've done is find some of my most common projects and modified the project templates thusly:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Local|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<-- SNIP -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Prod|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Content Include="Web.config" />
<Content Include="Web.Local.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Dev.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Test.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Preprod.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Prod.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<ProjectItem ReplaceParameters="true" TargetFileName="Web.config">WebApiWeb.config</ProjectItem> <ProjectItem ReplaceParameters="true" TargetFileName="Web.Local.config">Web.Local.config</ProjectItem> <ProjectItem ReplaceParameters="true" TargetFileName="Web.Dev.config">Web.Dev.config</ProjectItem> <ProjectItem ReplaceParameters="true" TargetFileName="Web.Test.config">Web.Test.config</ProjectItem> <ProjectItem ReplaceParameters="true" TargetFileName="Web.Preprod.config">Web.Preprod.config</ProjectItem> <ProjectItem ReplaceParameters="true" TargetFileName="Web.Prod.config">Web.Prod.config</ProjectItem>
When I create the new projects, all of my desired environments are there, and debug is gone! However, Release is still there, including the web.Release.Config file, which I deleted. Any idea where this extraneous config file/build configuration may be coming from?
Yes, create a custom project template. If this does not suffice, you can even create a custom project type, which is a bit more involved, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With