Razor - microsoft-web-helpers Question

In my Views I want to use eg WebGrid Helper. Using Library Package Manager I added microsoft-web-helpers in Visual Studio which added the System.Web.Helpers namespace to my module-project references.
When trying to add this namespace to my View, the system doesn't recognize this namespace?

The microsoft-web-helpers library that you installed into your project does not include the WebGrid component. For a list of the add-on components installed in this library, see the documentation for the Microsoft.Web.Helpers namespace:

To be able to use the WebGrid helper (which is indeed in the System.Web.Helpers namespace), you need to first install ASP.NET Web Pages with Razor syntax. There are 2 ways to do that: install Microsoft WebMatrix by using the WebPI, or (since
you are using VS) just install MVC3 which will include VS tools so that you can use ASP.NET Web pages with Razor syntax.

For info on how to install MVC3 and set up VS for working with the Razor syntax, see the following. After you've installed MVC3 as described, your VS installation will "recognize" the System.Web.Helpers NS and the WebGrid helper.

This should work at this point. Shouldn't have to do anything other than add a reference. If, in your site or project, you added a reference by browsing to the local ASP.NET Web pages installation folder and pointing to the System.Web.Helpers
assembly, then you should be able to reference System.Web.Helpers.WebGrid in your code, I double-checked it just now and it worked.

I added the reference to System.Web.Helpers to my module. Obviously something goes wrong because @using System.Web.Helpers gives an error message (can't find it). Even when adding the assembly to the module's web.config.

Gdillen I see what you mean, I can repro the fact that if I sync my enlistment to latest Orchard source, build the site, and then open the "Orchard.Web" site in VS, and add a reference to the System.Web.Helpers.dll assembly from ASP.NET Web Pages, it seems
like Intellisense does not want to recognize statements such as @using System.Web.Helpers; in a .cshtml file. However, I also noticed the following items that DO work:

* In a .cs code file, I can definitely access System.Web.Helpers, and controls within the NS including the Webgrid. So, VS does know that the assembly is there and recognizes the namespace.

* Also, in a .cshtml file, even though Intellisense doesn't want to recognize statements like the one above, I found that I could still add such statements to the file, and they would successfully build and the page works at runtime. Have you tried
this? I found that if I add a @using System.Web.Helper; line to a .cshtml file in the project, it builds and runs even though Intellisense doesn't pick up on it.

This makes you wonder if we have some kind of Intellisense issue with Razor pages. Not sure what the general problem is though, because in VS, I tried another approach, namely creating a new MVC 3 project in which I go with the default Razor view engine.
And in View pages in that new app, it recognizes System.Web.Helpers NS in Intellisense just fine. So whatever the problem is, it seems to be unique in Orchard, it doesn't seem to apply to all MVC apps.

Razor Intellisense works fine for me like this. You should add System.Web.Helpers into the <system.web.webPages.razor> bit (although I haven't tested System.Web.Helpers myself so maybe there's another problem going on here).