Created
March 4, 2014 17:51
-
-
Save HakanL/9351871 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- | |
Xipton.Razor v2.5 | |
The web.config configuration file only is for activating Razor intellisense inside Razor templates, within non MVC projects. Note | |
that for being able to use Razor intellisense MVC 3 or MVC 4 need to be installed on your system. MVC is not needed for compiling | |
Xipton.Razor templates. | |
You need to add the web.config to your non MVC template project besides your default app.config. The configured MVC and Razor assemblies | |
(here MVC version 3) need to be installed at your environment. Xipton.Razor uses Razor 2.0 (part of MVC 4), still you can use this | |
configuration (MVC 3, Razor 1) as long as MVC 3 has been installed at your system as well. If you do not have MVC 3 installed on your | |
system you need to configure the MVC version (and configuration) in accordance to the version that is on your system. | |
Important: | |
If you reference Xipton.Razor as a dll (and not as a project) and you want to use intellisense you must install the signed Xipton.Razor.dll | |
inside the GAC (please note that this is required only for being able to use intellisense, not for deployment). | |
In that case the @model directive does not work together with intellisense (the template will compile though). Therefore if referencing | |
Xipton.Razor as a signed dll (that must have been installed inside the GAC) you need to use the @inherits directive for a working intellisense | |
like "@inherits Xipton.Razor.TemplateBase<MyModel>". | |
Within MVC projects: | |
If you work with Xipton.Razor together with MVC, then you use your MVC project's app.config. In that case you could install the | |
Xipton.Razor.dll in the GAC as well. Inside the MVC app.config you add an assembly reference for the Xipton.Razor.dll like: | |
<system.web> | |
<compilation targetFramework="4.0"> | |
<assemblies> | |
<add assembly="Xipton.Razor, Version=2.4.0.0, Culture=neutral, PublicKeyToken=563e02c711ac8b7e" /> | |
</assemblies> | |
</compilation> | |
</system.web> | |
Now inside your Xipton.Razor templates you need to use the directive @inherits, like "@inherits Xipton.Razor.TemplateBase<MyModel>", | |
instead of the @model directive. | |
--> | |
<configuration> | |
<configSections> | |
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> | |
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> | |
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.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=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | |
<!-- | |
the next element is required when using (as a reference from your project) the signed Xipton.Razor that has been installed inside the GAC (check information at top) | |
If you use a direct project reference to Xipton.Razor.csproj (in that case ensure signing to be off) you must replace it by: | |
<pages pageBaseType="Xipton.Razor.TemplateBase> | |
--> | |
<pages pageBaseType="Xipton.Razor.TemplateBase, Xipton.Razor, Version=2.6.1.0, Culture=neutral, PublicKeyToken=563e02c711ac8b7e"> | |
<namespaces> | |
<add namespace="System"/> | |
<add namespace="System.Collections"/> | |
<add namespace="System.Collections.Generic"/> | |
<add namespace="System.Dynamic"/> | |
<add namespace="System.IO"/> | |
<add namespace="System.Linq"/> | |
<add namespace="SchemaExposer"/> | |
<add namespace="SchemaExposer.Naming"/> | |
<add namespace="Xipton.Razor.Extension"/> | |
</namespaces> | |
</pages> | |
</system.web.webPages.razor> | |
<system.web> | |
<compilation targetFramework="4.0"> | |
<assemblies> | |
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> | |
<add assembly="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> | |
<!-- | |
the next element is required when using (as a reference from your project) the signed Xipton.Razor that has been installed inside the GAC (check information at top) | |
If you use a direct project reference to Xipton.Razor.csproj you must remove it. | |
--> | |
<add assembly="Xipton.Razor, Version=2.6.1.0, Culture=neutral, PublicKeyToken=563e02c711ac8b7e" /> | |
</assemblies> | |
</compilation> | |
</system.web> | |
<appSettings> | |
<add key="webpages:Version" value="3.0.0.0"/> | |
</appSettings> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> | |
</startup> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment