Our team uses the Code Analysis feature with a custom ruleset to cause our build to fail if we forget to do things like null checks on method arguments.
However, now
Apparently the right way to do this is to install the Microsoft.CodeAnalysis.FxCopAnalyzers NuGet package. This works great, even on ASP.NET Core projects, and doesn't require the
flag at all.
I realized that there's another tag in the csproj file which actually enables code analysis. The
tag in my .csproj file now looks like this:
netstandard1.4
..\MyCompanyCodeAnalysisRules.ruleset
true
And it works great, at least on normal projects. An ASP.NET Core project is producing the following errors:
CA0055 : Could not identify platform for 'C:\Source\...\bin\Debug\netcoreapp1.1\....dll'.
CA0052 : No targets were selected.