You can edit the default project template that Visual Studio uses when creating a new project to add general imports, the problem is when it comes to prototyping, you want these options enabled.
I try to make every project import a common set of msbuild properties and item groups. This will not work by default, since you will need to edit each proj file and add import, but the advantage is that with just one line you could add much more than just code analysis parameters in this imported proj file, for example StyleCop settings, the dictionary culture used by Code Analysis, its own rule set file, shared AssemblyInfo.cs, snk files, etc.
I usually put the next line immediately before the last line in my .csproj
<Import Project="..\Build\MyCompanySettings.proj" />
And then in the imported file something like this. Thus, ever a project has the same settings.
<?xml version="1.0" encoding="utf-8" ?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <RunStyleCop>true</RunStyleCop> <StyleCopOverrideSettingsFile>..\Build\Settings.StyleCop</StyleCopOverrideSettingsFile> <RunCodeAnalysis>true</RunCodeAnalysis> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <SignAssembly>true</SignAssembly> <AssemblyOriginatorKeyFile>..\Build\MyCompany.snk</AssemblyOriginatorKeyFile> <CodeAnalysisRuleSet>..\Build\MyCompany.ruleset</CodeAnalysisRuleSet> <StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings> <SkipPostSharp>True</SkipPostSharp> <CodeAnalysisCulture>en-GB</CodeAnalysisCulture> </PropertyGroup> <ItemGroup> <None Include="..\Build\MyCompany.snk"> <Link>MyCompany.snk</Link> </None> <CodeAnalysisDictionary Include="$(BuildTargetsDirectory)\MyCompanyCustomDictionary.xml"> <Link>Properties\MyCompanyCustomDictionary.xml</Link> </CodeAnalysisDictionary> <Compile Include="..\Build\VersionInfo.cs" > <Link>Properties\VersionInfo.cs</Link> </Compile> <None Include="..\Build\MyCompany.ruleset" > <Link>MyCompany.ruleset</Link> </None> </ItemGroup> <Import Project="$(MSBuildProgramFiles32)\MSBuild\StyleCop\v4.7\StyleCop.targets" Condition="'$(RunStyleCop)' == 'true'"/> </Project>
source share