2013-06-28 17 views
5

チームと私は多くのプロジェクトにVS2012を使用しており、ローカル、開発ステージング、テスト、プリプロダクション、およびプロダクションの5つの環境を含むQAおよびUATグループのワークフローを開発しました。私たちは、プロジェクト/ソリューションごとにLocal/Dev/Test/Preprod/Prodビルド設定を作成し、デバッグとリリースの設定を削除する必要があることを知りました。Visual Studioに既定のビルド構成を追加する

VSに、デバッグ/リリース構成ではなく、新しいプロジェクトにこれらの環境をデフォルトで作成させる方法はありますか?

EDIT: ビルド設定がすべて個別のプロジェクトフォルダ内にあるため、グローバルオプションを見つけることができませんでした。私がやった何

は私の最も一般的なプロジェクトのいくつかを見つけることですし、thuslyプロジェクトテンプレートを変更:

  • が.csprojファイルを変更し、以下でPropertyGroupsを置き換える:私の適切な追加
    <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>
  • Web.Configのディレクティブを変換する次のような
    <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>
  • は私.vstemplateファイルを修正し、Web.Debugを交換しWeb.Release設定エントリ:
    <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>
  • Web.Debug.configをWeb.Local.config、Web.Dev.config、およびWeb.Test.configにコピーし、Web.Release.configをWeb.Preprod.configとWeb.Prod.configに変更しました。

新しいプロジェクトを作成すると、私の希望する環境がすべてあり、デバッグはなくなりました!しかし、削除されたweb.Release.Configファイルを含め、リリースはまだそこにあります。この無関係な設定ファイル/ビルド設定がどこから来ているのか、

答えて

2

はい、custom project templateを作成してください。これで十分でない場合は、custom project typeを作成することもできますが、これはもう少し複雑です。

+0

私はプロジェクトテンプレートをエクスポートしました。これは私のチームのためにうまく機能しているようです。ただし、インポート時にはリリースファイル/ビルド構成は引き続き使用されます。助言がありますか? – greven

関連する問題