Does TeamCity support Roslyn code analysers?

Since VS2015, Visual Studio has added support for Roslyn-based code analysers, basically rolling FxCop's post-build static analysis into a compile time function within the IDE. TeamCity supports FxCop quite nicely, but if I were to replace my FxCop configurations for the Roslyn analysers, will TeamCity be able to pull that information out of the build logs and continue to display statistics based on it (e.g. number of warnings/errors etc)?

 

There appear to be some hacky approaches to it (http://www.damirscorner.com/blog/posts/20160604-RunningCodeAnalyzersOnBuildServer.html), but by 2018, TeamCity should be able to handle this out-of-the-box.

2
2 comments

Hi,

TeamCity allows parsing FxCop reports and could report warnings/build problems from them. Ensure that you have enabled advanced "Fail on analysis errors" option for FxCop build step. If you want to treat analysis warnings as errors you could enable corresponding option in your project file the same way as author of the mentioned post.

If you're running analysis during MSBuild step TeamCity also will recognize errors/warnings there and will highlight them in the build log.

Please let us know if you have problems with analysis reporting in your case.

0
Avatar
Permanently deleted user

Hi Dmitry,

So when you say that analysis run during the MSBuild phase (which is what Roslyn will be doing) will be highlighted in the build log, will there be any support for pulling that information out of the build log and displaying it in the Code Inspections tab, as currently happens if I run an FxCop build step?

2

Please sign in to leave a comment.