Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix fxcop running on netstandard2.0 and failing #243

Conversation

lmolkova
Copy link
Member

@lmolkova lmolkova commented Dec 31, 2018

In #239 new ILogger was introduced that targets netstandard 2.0 and build fails because of code analyzers

CA0055 : Could not identify platform for 'E:\A\_work\107\bin\Release\src\ILogger\netstandard2.0\Microsoft.Extensions.Logging.ApplicationInsights.dll'.
CA0052 : No targets were selected

https://stackoverflow.com/questions/46617261/enabling-code-analysis-for-net-core-2-0-project-results-ca0055-and-ca0052-error

This error is caused by using an old version of Code Analysis with .NET Core. This old version is only for non-.NET Core applications.
The solution is to disable the old Code Analysis for .NET Core projects and install the new version of Code Analysis, which is now a NuGet package. (The reason you probably want to disable the old Code Analysis tool for your project and NOT uninstall it is so that you can still use the old Code Analysis with old .NET applications, such as .NET 4.5.)

To fix it, we need to remove RunCodeAnalysis from Common props and set it on the projects that need it.

@lmolkova
Copy link
Member Author

@cijothomas please review

Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cijothomas cijothomas merged commit 5c15d44 into microsoft:develop Dec 31, 2018
@lmolkova lmolkova deleted the lmolkova/fixCodeAnalyzerIssuesOnNetcore20 branch December 31, 2018 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants