0
votes

Severity Code Description Project File Line Suppression State Error CS1061 'IServiceCollection' does not contain a definition for 'AddDefaultIdentity' and no accessible extension method 'AddDefaultIdentity' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) WebHesab C:\Users\DELL\source\repos\WebHesab\WebHesab\Startup.cs 36 Active

enter image description here

1
copy and past the code here... then ensure you have nuget package Identity for entityframe work... - Seabizkit
Does your IServiceCollection match the calling ServiceCollection class? Make sure all public functions for your ServiceCollection class are mentioned in the IServiceCollection - DJ Burb
Put using Microsoft.Extensions.DependencyInjection; at the top of your startup.cs If you right-click on the red underline, it will tell you how to fix it and even do it for you. - Andy

1 Answers

0
votes

You would need to add a reference to the Microsoft.AspNetCore.Identity.UI nuget package in order to use AddDefaultIdentity.

dotnet add package Microsoft.AspNetCore.Identity.UI --version 5.0.2