90

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

  • System.Web.Helpers.dll
  • System.Web.WebPages.dll
  • System.Web.Razor.dll

The only one I can see when I do Add Reference is System.Web.Razor, but I don't know where the other ones are.

Yuck
  • 49,664
  • 13
  • 105
  • 135
Xaisoft
  • 45,655
  • 87
  • 279
  • 432
  • Possible duplicate question: [System.Web.Helpers not found in VS2015](https://stackoverflow.com/questions/34402956/system-web-helpers-not-found-in-vs2015/34403205) – jmbmage Jul 24 '18 at 13:43

12 Answers12

33

You will find these assemblies in the Extensions group under Assemblies in Visual Studio 2010, 2012 & 2013 (Reference Manager)

Ofer Zelig
  • 17,068
  • 9
  • 59
  • 93
W3Max
  • 3,328
  • 5
  • 35
  • 61
  • 2
    I believe question says in Visual Studio 2010 (look at the tags) – AaA Feb 05 '15 at 15:38
  • 25
    Nope, I didn't find these assemblies in the Extensions (VS 2015, MVC 4, .NET 4.5.2) – RJB Jun 16 '16 at 05:09
  • 4
    I think they are part of `Microsoft.AspNet.WebPages` (which is dependent on `Microsoft.AspNet.Razor` which is also needed for some of these namespaces) today. – Ofer Zelig Apr 05 '17 at 06:59
23

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.

user15741
  • 1,392
  • 16
  • 27
  • System.Web.Helpers.dll in the System-Web-Helpers.dll nuget package is the latest and works with VS 2017. Contains just the System.Web.Helpers.dll. That's all. – Debbie A Mar 16 '21 at 15:27
17

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.

Ezra Steinmetz
  • 1,267
  • 1
  • 17
  • 18
16

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

mohsen dorparasti
  • 8,107
  • 7
  • 41
  • 61
  • 11
    In Visual Studio 2012, look in the Extensions filter on the left hand-side, as per comment below - in case you don't read that far (as I did not). – EnocNRoll - AnandaGopal Pardue Apr 26 '13 at 16:27
  • What do you mean by pass the firs list? there is only one list and can be sorted with component name! what is the name you are referring to? to see those DLL's MVC3 should be installed and it won't install if you don't have IIS in your computer – AaA Feb 05 '15 at 15:17
13

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

Waqas
  • 317
  • 3
  • 2
  • 3
    Visual studio 2010 does not have Select Assemblies or Extensions or ... You are referring to Visual Studio 2012 and above – AaA Feb 05 '15 at 15:39
  • For VS 2010 select project References->add Reference->.NET tab-> click Component Name to organize list->should see system.web.helpers.. – eaglei22 Dec 14 '15 at 23:01
  • 1
    System.Web.Helpers does not exist under Select Assemblies - > Extensions – Casey Crookston Nov 13 '17 at 16:22
12

Installing ASP.NET MVC3 from here should help.

Malice
  • 3,927
  • 1
  • 36
  • 52
7

This particular NuGet package has a habit of losing its references in one of our projects. From time to time I will need to run the following command in the Package Manager Console to restore the references and everything is OK again

Update-Package Microsoft.AspNet.Webpages -reinstall
MichaelM
  • 964
  • 7
  • 20
6

On VS2017 I installed the NuGet package: Microsoft.AspNet.WebPages

That did the trick.

stalagluft
  • 81
  • 1
  • 5
5

I had to install RazorGenerator.Templating to get it all to work. From the NuGet console, type:

Install-Package RazorGenerator.Templating

Yuck
  • 49,664
  • 13
  • 105
  • 135
Xaisoft
  • 45,655
  • 87
  • 279
  • 432
4

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.

SCBuergel
  • 1,613
  • 16
  • 26
4

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.

Andrew Stanton-Nurse
  • 6,274
  • 1
  • 28
  • 20
1

When you install this nuget package Microsoft.AspNet.WebPages they can be find in C:\Program Files (x86)\Microsoft Visual Studio\Shared\Packages\Microsoft.AspNet.WebPages.x.x.x\lib\net45

mrosiak
  • 2,547
  • 1
  • 14
  • 7