How to remove warning AD0001 in .Net Core project?

Viewed 2640

This is the warning message

warning AD0001: Analyzer 'Microsoft.AspNetCore.Mvc.Analyzers.TopLevelParameterNameAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.

enter image description here

Any kind of help is appreciated. Thank you

2 Answers

Check this https://github.com/dotnet/aspnetcore/issues/14723

Disable analyzer in Project file for testing purpose only.

<PropertyGroup> <DisableImplicitAspNetCoreAnalyzers>true</DisableImplicitAspNetCoreAnalyzers>
</PropertyGroup>

After disabling this, check if you can still build the project.Check if any install package have prior version dependency.

I have been accessing

Microsoft.AspNetCore.MVC

package to access HttpContextAccessor and that causes the WARNING.

I solved this by reinstalling dependency/reference for HttpContextAccesstor and it lands me to this package

Microsoft.AspNetCore.Http.Abstractions

SOLVED

Related