Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Analysis as Warning Locally but Error on TFS Build

I'd like Code Analysis violations to show up as warnings locally (so that devs can still F5 run even if there are CA violations), but as Errors in the TFS Build (more specifically I'd like the build to fail).

I still want to maintain the list of rules I care about in one place though, so I don't want to have to create separate ruleset files for local/TFS.

Any ideas for how I could configure this?

like image 333
Dylan Smith Avatar asked Feb 11 '23 11:02

Dylan Smith


1 Answers

Add a msbuild parameter on the build definition. I thinks its /p:CodeAnalysisTreatWarningsAsErrors=true

like image 102
Kyle Avatar answered Feb 14 '23 09:02

Kyle