4

I have set up code analysis on all my solution's projects in VS 2015 and it runs fine. In one of the projects, there is .ruleset file and all other projects reference that file as a rule set for their code analysis. Now I want this same code analysis to be run on TeamCity which runs on Windows Server 2012 R2 without VS installed.

I have tried /p:RunCodeAnalysis=True as command line parameter to MSBuild step as proposed here. But this option was apparently ignored since build log did not say anything about running code analysis. I did not setup FxCop build step because it required .dll files to be pointed to, but I wanted Code Analysis to actually analyse code in my solution, and not IL.

Is solution proposed here the only one possible? It looks a bit like an error-prone hack to me.

Community
  • 1
  • 1
Oleksandr Nechai
  • 1,811
  • 16
  • 27

1 Answers1

5

I had a similar problem recently where the /p:RunCodeAnalysis=True command was ignored.

I then found that creating system parameters for the various msbuild parameters works without any hassles. See the image below as an example of various parameters that is passed to msbuild without having to do it the "old fashioned" way.

I do hope that this helps as i know the frustrations around build config performing different to what is expected.

enter image description here

Note: in our case we needed to turn off code analyses temporarily.

thewikus
  • 445
  • 1
  • 5
  • 16