I am interested in setting up FxCop to run on each of our VS .csproj files in our developing environment by calling it as a target in the .csproj file itself without creating a separate MSBuild file for the project. Is this
<Target Name="AfterBuild">
<Exec Command=""C:\Program Files\Microsoft FxCop\FxCopCmd.exe" /searchgac /p:FxCopProject.fxcop /out:FxCopOutput.xml" ContinueOnError="true">
</Exec>
</Target>
possible to get working in one way or another being included at the ta开发者_Python百科il end of my .csproj file?
I think you're looking for the post-build event.
- Right Click the Project
- Click Properties
- Go to the "Build Events" Tab
- Add the command line to the "Post-build event command line" box.
The following should work - paste it anywhere at just under the node level:
<PropertyGroup>
<PostBuildEvent>"%25ProgramFiles%25\Microsoft FxCop 1.36\FxCopCmd.exe" /p:$(SolutionDir)Bank.FxCop /o:$(TargetDir)FxCopResults.xml /d:"%25ProgramFiles%25\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies"
</PropertyGroup>
Note the /d parameter I'm using to point to where my project is using additional assemblies (in this case, the MSTest unit testing stuff).
精彩评论