|
|
|
|
|
|
Are you doing this in the web.config of your module, or of the Orchard.Web project?
|
|
|
|
There is a separate web.config in the Views folder of my module, which looks like the perfect place to do this.
|
|
|
|
Are you saying that's where you tried it? Why not try Orchard.Web\web.config and see if it works?
|
|
|
|
Because I want a specific namespace to be available in a single module views.
|
|
Feb 6 at 12:56 PM
Edited Feb 6 at 12:57 PM
|
Right, makes sense, my mistake.
I've done what you're asking by editing the web.config of my module in two places. In my case I was adding the System.Transactions namespace to be available in my module's Razor views:
<configuration>
<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" />
<add namespace="System.Transactions" />
</namespaces>
</pages>
</system.web.webPages.razor>
</configuration>
<configuration>
<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.Helpers, Version=1.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" />
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
</configuration>
|
|
|
|
Great, works for me.
Thanks Your Highness ;)
|
|