-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSC Error AD0001 CSharpDiagnosticAnalyzerApiUsageAnalyzer NullReferenceException #2961
Comments
It's happening for us in .NET Framework 4.7.2 projects too. |
Can you try to add a package reference to the latest stable version of https://www.nuget.org/packages/Microsoft.CodeAnalysis.Analyzers/? |
@mavasani I have the latest version installed as detailed in the opening post. Unless 2.9.6 (which your link points to) isn't the latest? |
@MattOG Your description mentions you have installed 2.9.6 version of Microsoft.CodeAnalysis.FxCopAnalyzers, but that package does not contain the ApiUsageAnalyzer. Did you also install latest version of Microsoft.CodeAnalysis.Analyzers, which contains this analyzer? |
@mavasani Apologies, my ability to read seems to have gone astray. I'm applying your suggestion now. Thanks. |
@mavasani This has solved this issue. |
Started getting this error after updating my solution to target .NetCore 3.0.
Attempted to use the (downgraded) version of 2.9.6-beta1.19502.2 as suggested here: #2889 (just in case) but as expected the error didn't go away.
It happens in 4 of the projects in the solution, each with a different entry under the ISymbol tag below.
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Package Version
v2.9.6 (Latest)
Diagnostic ID
AD0001 Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnalyzerApiUsageAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
Repro steps
Expected behavior
Not an AD0001 error
Actual behavior
An AD001 error
The text was updated successfully, but these errors were encountered: