Skip to content

warning AD0001: Analyzer 'Microsoft.NetCore.Analyzers.Performance.UseConcreteTypeAnalyzer' threw an exception of type 'System.NullReferenceException' #53692

@lcsondes

Description

@lcsondes

Describe the bug

CSC : warning AD0001: Analyzer 'Microsoft.NetCore.Analyzers.Performance.UseConcreteTypeAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
CSC : warning AD0001: Analyzer 'Microsoft.NetCore.Analyzers.Performance.UseConcreteTypeAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.

That's all the information I'm given, no notes, no stack traces. <NoWarn>AD0001</NoWarn> successfully works around the issue.

I have narrowed its source down to a commit in a private repo, but there isn't any part of it that I can comment out to make the exceptions go away. Facsimiles of the changed classes in a sandbox project don't reproduce the warnings. I'd like to provide more information, but I need help. How can I debug a built-in SDK analyzer running as part of my build?

To Reproduce

That's what I'd like to find out.

Exceptions (if any)

'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'

Further technical details

details of dotnet --info

.NET SDK: Version: 10.0.201 Commit: 4d3023de60 Workload version: 10.0.200-manifests.121cc9e6 MSBuild version: 18.3.0-release-26153-122+4d3023de6

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.201\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.5
Architecture: x64
Commit: a612c2a105

.NET SDKs installed:
10.0.103 [C:\Program Files\dotnet\sdk]
10.0.201 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
DOTNET_CLI_TELEMETRY_OPTOUT [1]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions