MVC 4 project does not resolve reference to System.Web.Helpers in VS 2015

时间:2015-09-01 22:51:58

标签: asp.net-mvc-4 visual-studio-2015

It works in VS2013, where the reference is found on the system at "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.Helpers.dll". This is not found on my clean Win10 install with VS2015.

Any ideas why?

1 个答案:

答案 0 :(得分:2)

It's because MVC 4 is not installed with VS 2015. You can install it from here.

Note that, strangely, you cannot install the nuget package microsoft-web-helpers, which contains this assembly. It will have a version conflict for one of it's dependencies with MVC 4.

Install-package : Unable to find a version of 'Microsoft.AspNet.WebPages' that is compatible with 'microsoft-web-helpers 2.1.20710.2 constraint: Microsoft.AspNet.WebPages (≥ 2.0.0 && < 2.1.0)', 'Microsoft.AspNet.Mvc 5.2.2 constraint: Microsoft.AspNet.WebPages (≥ 3.2.2 && < 3.3.0)'. At line:1 char:1