Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Roslyn Code Analyzers on Build Server

I'm trying to create custom static analysis rules against my code base such that compiler errors will be generated if a developer fails to follow my companies coding convention. It seems with Visual Studio 2015, Roslyn Code Analyzers are the way to accomplish this.

The MSDN articles I've read indicate Code Analyzers are packaged up as NuGet or VSIX packages. That's great for adding red squiggles in Visual Studio, but I want to make sure the compiler errors are also generated on my Jenkins build server.

Are Roslyn Code Analyzers run as part of the MSBuild pipeline in such a way that they will generate compiler errors on my build server? Do I need to setup MSBuild in anyway?

like image 343
Philip Pittle Avatar asked Mar 10 '16 20:03

Philip Pittle


1 Answers

Yes; Analyzers are integrated with MSBuild.

Analyzer References in Visual Studio are part of the project file, and the Roslyn MSBuild task will pass the to the compiler.

You don't need to do anything.

like image 54
SLaks Avatar answered Oct 10 '22 23:10

SLaks