...
In order to activate code reviews with MSBuild you need to add a block of XML to your .NET project file. This can be done using a target edit like the one shown below
Code Block |
---|
<gmBasic>
...
<Compile Project="%SrcPath%" />
<Analyse />
<Output Status="New" Filename="%BndPath%" />
<Author>
<Fix>
<!-- the following target edit turns on code analysis -->
<Replace name="U: Add Code Analysis to MSBuild step" lang="csproj">
<OldBlock><![CDATA[
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
]]></OldBlock>
<NewBlock><![CDATA[
<ErrorReport>prompt</ErrorReport>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
]]></NewBlock>
</Replace>
</Fix>
</Author>
...
</gmBasic> |
...
Once RunCodeAnalysis is on, the .NET Build Logs will include code analysis information. The Text Plan for the Standard .NET Build Test can also be used for the .NET Build Text with Code Analysis.
...