Category ASP.NET Core

error-solved

[Solved] InvalidOperationException: Unable to resolve service for type ‘Interface’ while attempting to activate the Controller in Asp.net core

Problem: In .NET Core MVC application, I was using Dependency Injection and Repository Pattern to inject a repository to my controller. However, I am getting an error: InvalidOperationException: Unable to resolve service for type ‘API_IN_COMPARE.Interface.ICategory’ while attempting to activate ‘API_IN_COMPARE.Controllers.WeatherForecastController’.…

error-solved

[Solved] Your startup project ‘solution name’ doesn’t reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.

Solution I solved this error by rechecking the the following points 1) The Microsoft.EntityrameworkCore.Design is installed in to the project The Microsoft.EntityrameworkCore.Design package has to be installed in to the project as shown in the below image 2) Select the…