Hi RakeshMallya-9894,
The CA warning codes are from Fxcop legacy analyzers, which are disabled in visual studio. And the CS warning codes are from Roslyn analyzers, which are working in visual studio.
When we use msbuild with "RunCodeAnalysis", it will use Fxcop analyzers to analysis your code.
So if you want to enable Fxcop analyzers in your visual studio, please follow steps bleow:
- Install Microsoft Code Analysis 2019(2017) in Extensions/Manage Extensions
- Install nuget package: Microsoft.CodeAnalysis.FxCopAnalyzers for your project
- The CA warning code will show in 'Error List' window.
- Or, please click "Run on Build" in Project Properties/Code Analysis, then you could check them in output window after building the project.
Best Regards,
Dylan