Where can I find System.Web.Helpers, System.Web.WebPages, and System.Web.Razor?

后端 未结 12 1221
南笙
南笙 2020-11-27 05:45

I am following this article on RazorGenerator and it say\'s that I must add references to:

  • System.Web.Helpers.dll
  • System.Web.WebPag
相关标签:
12条回答
  • 2020-11-27 06:05

    I had the same problem , first I couldn't find those dlls in the list of .NET components . but later I figured it out that the solution is :

    1- first I changed target framework from .NET framework 4 client profile to .NET framework 4.

    2- then scroll down the list of .NET components , pass first list of system.web... , scroll down , and find the second list of system.web... at the bottom , they're there .

    I hope this could help others

    0 讨论(0)
  • 2020-11-27 06:05

    To sum up all of the options for VS 2017, WebHelpers was installed by installing MVC in previous versions of Visual Studio. If you're getting this error, you probably don't have the older versions of VS installed anymore.

    So, installing the Microsoft.AspNet.MVC NuGet package will require Microsoft.AspNet.WebPages and Microsoft.AspNet.Razor, and the Microsoft.AspNet.WebPages includes System.Web.Helpers.dll.

    If you've got direct references to System.Web.Mvc.dll and you don't want to use NuGet for MVC, you can get the Microsoft.AspNet.WebPages NuGet, or there are some other NuGet packages that only contain System.Web.Helpers.dll, like the microsoft-web-helpers or System-Web-Helpers.dllpackages.

    There appear to be 2 versions of System.Web.Helpers.dll, one for .Net 4.0 and one for 4.5. Choosing the correct version of MVC or AspNet.WebPages will ensure you get the right one.

    0 讨论(0)
  • 2020-11-27 06:06

    As for VS2017 I didn't find it in "extensions", there's a Nuget package called "microsoft-web-helpers" that seems to be equivalent to System.Web.Helpers.

    0 讨论(0)
  • 2020-11-27 06:08

    In VS 2010 just right click on project or on reference and click add reference. On the popup window Select Assemblies - > Extensions -> System.Web.Helpers

    0 讨论(0)
  • 2020-11-27 06:10

    They should be under C:\Program Files\Microsoft ASP.Net (or C:\Program Files (x86)\Microsoft ASP.Net if you're on a 64-bit OS) in a subfolder for MVC3 or WebPages.

    0 讨论(0)
  • 2020-11-27 06:12

    The issue is a missing or outdated version of MVC. I was running VS 2015Preview and could resolve the issue by installing the latest version of MVC via NuGet.

    Just in case anyone is still coming across this one.

    0 讨论(0)
提交回复
热议问题