Roslyn Analyzer Rule does not fail the build
问题 Following on from this tutorial from MS, I have created an analyzer for Roslyn. According to the page, you can mark the rule as DiagnosticSeverity.Error , and this will cause the build to break: In the line declaring the Rule field, you can also update the severity of the diagnostics you’ll be producing to be errors rather than warnings. If the regex string doesn’t parse, the Match method will definitely throw an exception at run time, and you should block the build as you would for a C#