C# – Cannot find AddMvc() in IServiceCollection in Visual Studio 2017

asp.net-corec

I have created a brand new asp.net core application.
I have added the mvc Nuget package yet I am getting the below error.

Microsoft.AspNetCore.Mvc.Core 1.1.3

'IServiceCollection' does not contain a definition for 'AddMvc' and no extension method 'AddMvc' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)**

Best Answer

Install-Package Microsoft.AspNetCore.Mvc -Version 1.1.3

--Update

Unload the project and Reload it again (restart)

Related Topic