Calling Roslyn Analyzers from command line

*爱你&永不变心* 提交于 2019-12-23 21:26:49

问题


Using Roslyn Analyzers while developing in Visual Studio 2015 is great. However, it would be even greater to be able to call analyzers from a pre-commit hook or a CI like TeamCity in order to make sure non-conformant code is flagged.

Is there any way to get the results of an analyzer by calling a command line utility or will this need to be custom made?


回答1:


Roslyn Analyzers can be ran by csc.exe or vbc.exe (the compilers themselves), so just invoke the compiler. Assuming your Continuous Integration is already building, and your analyzers are added to the project file or to a NuGet package, this should Already Be Working™.



来源:https://stackoverflow.com/questions/35322126/calling-roslyn-analyzers-from-command-line

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