Cleaning up warnings in your project sometimes brings you to strange places. One of the more notable one was the depreciation warning for FxCop. We use StyleCopAnalyzers in our projects and there was no reference whatsoever to FxCop. Yet the build agent had a different opinion and showed this warning:
Warning – CA0507 – Post-build Code Analysis (FxCopCmd.exe) has been deprecated in favor of FxCop analyzers, which run during build. Refer to https://aka.ms/fxcopanalyzers to migrate to FxCop analyzers.
The reason this error pops up is because the project file has the option RunCodeAnalysis set to true instead of false. All you need to do is to check that every entry for RunCodeAnalysis looks like this:
1 |
<RunCodeAnalysis>false</RunCodeAnalysis> |
Save your project file, recompile your application and the warning about FxCop will no longer appear.