Run Roslyn Code Analyzers on Build Server

邮差的信 提交于 2020-01-12 18:34:33

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/35926915/run-roslyn-code-analyzers-on-build-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!