Answers for "system.invalidoperationexception: unable to resolve service for type 'microsoft.aspnetcore.identity.rolemanager`"

C#
1

Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager

services.AddIdentity<Automobile.Models.Account, IdentityRole>(options =>
    {
        options.User.RequireUniqueEmail = false;
    })
    .AddEntityFrameworkStores<Providers.Database.EFProvider.DataContext>()
    .AddDefaultTokenProviders();
Posted by: Guest on November-23-2020
1

System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger`1

public void ConfigureServices(IServiceCollection services)
    {
        var serviceProvider = services.BuildServiceProvider();
        var logger = serviceProvider.GetService<ILogger<AnyClass>>();
        services.AddSingleton(typeof(ILogger), logger);
        ...
     }
Posted by: Guest on November-28-2020

Code answers related to "system.invalidoperationexception: unable to resolve service for type 'microsoft.aspnetcore.identity.rolemanager`"

C# Answers by Framework

Browse Popular Code Answers by Language