Stylecopanalyzers: How to fail .netcore2.0 build on stylecop warnings

Created on 2 Aug 2017  路  2Comments  路  Source: DotNetAnalyzers/StyleCopAnalyzers

Is there a way to make the build fail on warning?

I can update ruleset and make all rules action="Error" but that is very tedious.

question resolved

Most helpful comment

Can we do this at solution level or pass it as additional parameter ?

All 2 comments

You can turn on Treat Warnings as Errors, but make sure to only do so for command line builds:
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/2592d5b3572490da5196dd730af95882348f9565/StyleCop.Analyzers/Directory.Build.props#L25-L28

Can we do this at solution level or pass it as additional parameter ?

Was this page helpful?
0 / 5 - 0 ratings