Earn income with your C# skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest self-service freelancing marketplace for people like you.

ASP.NET Core Dependency Injection error: Unable to resolve service for type while attempting to activate.

Application is trying to create an instance of Controller but it doesn't know how to create an instance of the tyupe that is passed into the Controller constructor.

Resolve this issue by adding the dependency in Program.cs file, like so: of which controller.

// Add scoped service in Program.cs

builder.Services.AddScoped<IService, Service>();

Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas.      Vsn 1.3.0