Razor intellisense ?

Jan 6, 2011 at 4:52 AM
Edited Jan 6, 2011 at 4:52 AM

When I look at cshtml files in VS2010 it seems that there's no intellisense.  Also there are many red lines appearing under words such as model BodyEditorViewModel, @Display and Model

@model BodyEditorViewModel
@using Orchard.Core.Common.ViewModels;
<fieldset>
    <label>@T("Body")</label>
    @Display.Body_Editor(Model)
    @Html.ValidationMessageFor(m => m.Text)
   
</fieldset>

I'm using MVC3 RC Release 2 and I was under the impression that they had added Intellisense to that version. 

Do I have something wrong with my setup or does everyone have the same problem?

Thanks

Jan 6, 2011 at 1:47 PM

See the following discussion threads:

http://orchard.codeplex.com/Thread/View.aspx?ThreadId=234151
http://orchard.codeplex.com/Thread/View.aspx?ThreadId=234870

Jan 6, 2011 at 3:31 PM

I'm having this same problem. I've added the lines from the first thread to the web.config in my module under the root folder and the one in the Views folder, but I still don't get any intellisense. 

Jan 6, 2011 at 8:55 PM

for your @model BodyEditorViewModel

have you tried putting the full name (include the namespace)

Jan 7, 2011 at 2:55 AM
Edited Jan 7, 2011 at 3:07 AM

What I am seeing is happening in most of the core Orchard cshtml files. It's not just the one file. I just picked this as an example. In the core cshtml files I see many red lines saying "the name xxxx does not exist in the current context" or blue lines "there is no registered provider for cshtml. Despite these underlines the code compiles and runs okay.

Here in the following code for example:

    @Html.ValidationMessageFor(m => m.Text)
    @HtmlString.Equals

The word @Html. on the first line appears with a red underline and no intellisense but when I start to type@ Html on the second line I get intellisense and it writes out the word HtmlString followed by intellisense giving me options to add Equals or ReferenceEquals

Coordinator
Jan 15, 2011 at 9:47 PM
Edited Jan 21, 2011 at 3:58 AM

Here is what you need to do to get IntelliSense in Orchard Razor pages in a module:

1. Install MVC3 RTM. This will add Razor IntelliSense support to Visual Studio 2010.

2. If using Resharper, install the latest update (5.1.2) to ensure Visual Studio IntelliSense and Resharper don't conflict with each other.

3. Drop the following web.config file in the root folder of the module you want IntelliSense support for (e.g. "~/Modules/Orchard.Comments" folder). You need to add this file to all modules you want IntelliSense support for.

UPDATE: Adding the "remove" element mentioned later in this thread:

 

<?xml version="1.0"?>
<configuration>
 
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <remove name="host" />
      <remove name="pages" />
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
 
  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>
      </namespaces>
    </pages>
  </system.web.webPages.razor>
 
  <system.web>
      <compilation targetFramework="4.0">
        <assemblies>
          <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
          <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </assemblies>
      </compilation>
    </system.web>
 
</configuration>

 

 

Jan 20, 2011 at 10:22 PM

We were having the same problem with the Orchard Gallery project. So I added these sections to the web.config. of the Orchard.Gallery module and it worked (great!). However, most of the views that we care about are in the Orchard Gallery theme. The theme is also a project, but when I added this to the web.config for the Orchard Gallery theme project, it didn't work. I still don't get the correct intellisense in the Razor views of the theme. Any idea what the issue might be with that? Thanks!

Coordinator
Jan 21, 2011 at 12:41 AM
Edited Jan 21, 2011 at 12:42 AM

It is working for me. I created a simple theme from the command line (as a separate project under "Themes"). I also made sure the theme has a corresponding .csproj file:

 

orchard> codegen theme MyTheme /BasedOn:TheThemeMachine /CreateProject:true /IncludeInSolution:true
Creating Theme MyTheme
Theme MyTheme created successfully

 

I went back to Visual Studio, added the web.config in the root folder of the theme, created a cshtml view under "Views" and IntelliSense started working.

Jan 21, 2011 at 1:39 AM

I am having the same problem that Kevin is having. I dumped the Web.config file mentioned above into the root of the Orchard.Comments module, and it works great to enable Intellisense for that module. But I cannot seem to get it to work properly for the theme templates?

I am trying to do this with 'The Theme Machine' template, which is what I am basing my theme on. I tried adding it to the existing Web.config file in the root of the Themes project, but that did not have any effect. So I then tried putting a brand new Web.config file into the 'TheThemeMachine' directory but that does not work either. Whenever I open up the Layout.cshtml file, I see red squiggles all over the place indicating VS is confused about the code.

Can someone post specific details on what needs to go where for the Themes in order to turn on Intellisense for Razor?

Jan 21, 2011 at 1:45 AM
Edited Jan 21, 2011 at 1:47 AM

Ha! I got it to work. You need to integrate the Web.config changes above into the Web.config file that is in the root of the Themes project. I must have done it wrong the first time I did it, but this time it worked. So the full content of my Web.config file for the Themes project is:

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>

  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <system.web>
    <httpHandlers>
        <!-- iis6 - for any request in this location, return via managed static file handler -->
        <add path="*/Theme.png" verb="*" type="System.Web.StaticFileHandler" />
    </httpHandlers>
    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <controls>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>

    <compilation targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </assemblies>
    </compilation>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers accessPolicy="Script,Read">
        <!--
        iis7 - for any request to a file exists on disk, return it via native http module.
        accessPolicy 'Script' is to allow for a managed 404 page.
        -->
        <add name="ThemePreviewImage" path="*/Theme.png" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
    </handlers>
  </system.webServer>
  
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Jan 21, 2011 at 1:58 AM

Ok, that works to fix Intellisense, but it breaks the code so that the web site won't run anymore. It complains saying that the <configSections> needs to be the first root child of the <configuration> section, but if I move it up to the first section, which does fix Intellisense, the CSS style sheet is not properly applied to the site?

I have to remove this entire section for the web page to actually function, but Intellisense won't work if that section is present:

  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

Any other suggestions?

Coordinator
Jan 21, 2011 at 2:28 AM
Edited Jan 21, 2011 at 2:29 AM

Yes, this makes sense.

That said, the "Themes" project is really a convenience we use to group the 3 "built-in/default" themes (TheAdmin, SafeMode and TheThemeMachine) in a single project. I think the recommendation for creating new themes is to create a separate project (for example using the command line tool in my previous post). The reason is that it will make it easier to add code specific to your theme (if you need) and also it will make it easier to create a package when(if) you want to share your theme on the Gallery.

To be clear, here is the layout for Themes by default

~/Themes
   /TheThemMachine
      Theme.txt
   /TheAdmin
      Theme.txt
   /SafeMode
       Theme.txt
   Themes.csproj <= Contain files for the 3 built-in themes above
   Web.config <= required: server settings applicable to _all_ themes, needed at run-time!

When creating a new theme, you get this:

~/Themes
   /MyTheme
      (MyTheme files: content and optionally code)
      MyTheme.csproj <= optional, needed for Visual Studio and adding customg code (like modules)
     Theme.txt
     Web.config <= optional, needed for Visual Studio IntelliSense only
   /TheThemMachine
      Theme.txt
   /TheAdmin
      Theme.txt
   /SafeMode
       Theme.txt
   Themes.csproj <= Contain files for the 3 built-in themes above
   Web.config <= required: server settings applicable to _all_ themes, needed at run-time!

The issue you ran into was due to adding the new theme in the existing "Themes.csproj" file. In that case, Visual Studio IntelliSense will look fo IntelliSense settings on the "~/Themes/web.config" file. However, that files currently only contains settings for server configuration (nothing for IntelliSense). When you create a new theme project (~/Themes/MyTheme/MyTheme.csproj), Visual Studio IntelliSense will look for IntelliSense settings in the new theme directory ("~/Themes/MyTheme/web.config")

Jan 21, 2011 at 3:03 AM

What are the required changes to the Web.config file in the root of the ~/Themes project such that Intellisense will work for those themes (the default ones)?

I can see that if I follow your direction I can make a separate project and it will probably work, but I want to get it to work for the default themes so I don't go cross eyed when I am looking at the code under that project?

What did I do wrong on my Web.config file?

Coordinator
Jan 21, 2011 at 3:55 AM

Ok, here is the web.config files in "~/Themes" that works for me (both intellisense and run-time). Note the "remove" elements. What happens is that the root web.config already has these razor section, and IIS complains about duplicate definitions when trying to serve a static file. Note also the "appSettings" section needs to be after the "configSections". I need to edit my initial post about web.config for "Modules"(add the "remove" elements) because I think it will prevent static content to be served from modules too. Sorry about that.

 

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <remove name="host" />
      <remove name="pages" />
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <system.web>
    <httpHandlers>
      <!-- iis6 - for any request in this location, return via managed static file handler -->
      <add path="*/Theme.png" verb="*" type="System.Web.StaticFileHandler" />
    </httpHandlers>
    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <controls>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>
    <compilation targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </assemblies>
    </compilation>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers accessPolicy="Script,Read">
      <!--
        iis7 - for any request to a file exists on disk, return it via native http module.
        accessPolicy 'Script' is to allow for a managed 404 page.
        -->
      <add name="ThemePreviewImage" path="*/Theme.png" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
Jan 21, 2011 at 8:12 PM

Perfect, that fixed it for me. Thanks!

Jan 22, 2011 at 12:54 AM

Ok, well as it turns out adding the:

      <remove name="host" />
      <remove name="pages" />

into the Web.config file is actually needed for ALL Web.config files if you expect the web site code to actually work after you are done. The crux of the problem is that in the Orchard project when you are building from the main solution, all the individual modules are built with as separate projects so they usually don't have a Web.config file in their root. The Web.config file in the root of the project is what we need to add to ensure that Razor Intellisense will work within that project file.

However when the web site actually RUNS, the code is all referenced from the directory structure on disk, so the base.js script file for instance comes from http://mysite.com/Core/Shapes/Scripts/base.js. So at runtime, when that file is served up, it looks at the Web.config file in the main web project root located here:

%project_root%/Orchard.Web/Web.config

for the entire site, as well as the Web.config file we just dumped into the root of the Orchard.Core project, which ends up living on disk here:

%project_root%/Orchard.Web/Core/Web.config

Hence when IIS is serving up anything from the Orchard.Core project, it will end up using both, and the second one has to be able to override things without messing it up. Hence then need for the remove entries or it will complain about the entries already being present, from the original Web.config file that it loaded first in the root of the web site.

For the most part files don't usually get served up by IIS from those directories anyway, since Views get compiled into an assembly dynamically at runtime, but REAL files like content files, CSS script files and Javascript files won't load correctly. Hence the reason I had the initial problem with the CSS styles not showing up, and most recently, why I could not figure out why the Javascript code was not working!

I hope that all makes sense :)

Feb 18, 2011 at 10:14 AM

Could anyone shed some light about wherefor the web.config inside the "Views" folder is?

For most modules/themes it contains references to MVC2 and sets pageBaseType="System.Web.Mvc.ViewPage" -- looks scary to me (but I'm new to all these MVC/Autofac/Razor/Orchard stuff).

Is anyone using ReSharper6 successfully for .cshtml files? I added the suggested web.config from this thread to the root of an module (Orchard.Experimental) and also added a reference to "System.Web.WebPages.Razor, Version=1.0.0.0" to the project so Resharper had nothing to complain about inside the web.config anymore -- but ReSharper keeps complaining about undefined "Display()", "Model" and so on (but surprisingly F12 works on these members).

Feb 26, 2011 at 2:15 PM

Only way i could get the new module to work with Orchard AND Razor syntax is to create a new MVC 3 app in Orchard.Web/Modules folder and add reference to Orchard.Core & Orchard.Framework.

Mar 2, 2011 at 5:37 PM

 

When using
<MvcBuildViews>true</MvcBuildViews>
inside the project file (.csproj) then the following line should be added to the <compilation><assemblies>-node of the web.config file:
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

 

May 25, 2011 at 10:07 PM
Edited May 25, 2011 at 10:08 PM

Hi there,

I just downloaded the Orchard 1.1 binary distribution, opened the Orchard.Web project with VS2010 SP1 + ASP.NET MVC 3 installed and the e.g. Display(), T(), Tag() and so on Orchard methods do not show when I open up the ThemeMachine's Layout.cshtml  and other views for editing. I checked and the two remove host/page lines are already present in the Web.config in the ~/Themes folder. What am I missing and how do I enable the Orchard extension methods to show up in intellisense? In which namespace and class are they anyway?

Thanks in advance!

Coordinator
May 25, 2011 at 10:12 PM

If you are going to use Visual Studio, you should be using the full source code, not the binary distribution.

Jan 4, 2012 at 6:13 PM
Edited Jan 4, 2012 at 6:21 PM

I had a couple of Intellisense and Resharper issues.

Everything is working okay now.

Below is a module web.config that works.

The lines that resolved the issues in relation to resharper were:


        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add namespace="System.Web.WebPages" />

<?xml version="1.0"?>
<configuration>

  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <remove name="host" />
      <remove name="pages" />
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="Orchard.Mvc.Html"/>
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <system.web>
    <compilation targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
    </compilation>
  </system.web>

</configuration>