ASP.NET Core Dependency Injection error: Unable to resolve service for type while attempting to activate
To break down the error message: Unable to resolve service for type ‘WebApplication1.Data.BloggerRepository’ while attempting to activate ‘WebApplication1.Controllers.BlogController’. That is saying that your application is trying to create an instance of BlogController but it doesn’t know how to create an instance of BloggerRepository to pass into the constructor. Now look at your startup: That is saying whenever a IBloggerRepository is required, create a BloggerRepository and … Read more