开发者

Running FxCop directly through VS project file

开发者 https://www.devze.com 2022-12-09 23:59 出处:网络
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 f

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="&quot;C:\Program Files\Microsoft FxCop\FxCopCmd.exe&quot; /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.

  1. Right Click the Project
  2. Click Properties
  3. Go to the "Build Events" Tab
  4. 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).

0

精彩评论

暂无评论...
验证码 换一张
取 消