Evgeni Dimitrov Evgeni Dimitrov - 7 months ago 77
ASP.NET (C#) Question

Visual Studio 2015 enable MVC 4 support

I have an ASP NET MVC 4 project that "works on my machine(old)". When I load a project in a fresh installation of VS 2015(on a new laptop) - a lot of assemblies are missing and when I try to build the project it complains that classes like ActionResult, Controller are missing.

I checked that on the old laptop the missing dependencies are coming from

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies
. On the new laptop I have only the xml descriptors of the packages but not the dlls.

What I have to install to use MVC 4 in Visual Studio 2015?

Edit: missing dependencies are:


  • System.Web.Helpers

  • System.Web.Mvc

  • System.Web.WebPages

  • System.Web.WebPages.Deployment

  • System.Web.WebPages.Razor


Answer Source

I Recommend getting them again from Nuget for your ActionResult Issue its Microsoft.AspNet.Mvc which is making issue.

Open Package Manager Console and insert the command below:

Install-Package Microsoft.AspNet.Mvc

Nuget has this feature that allows you to restore all the missing Assemblies which exists in nuget. you can try that out as well.

Anyway for the rest of them install these packages below as well:

  • Install-Package Microsoft.AspNet.WebHelpers
  • Install-Package Microsoft.AspNet.WebPages
  • Install-Package Microsoft.AspNet.Razor