I am using the Razor Engine ( razorengine.codeplex.com ) in a non-MVC environment. I collect templates stored in files and use @inherits to support intellisense.
- Razorengine assembly
- Custom assembly - links RazorEngine contains
View<> and sets View<> as a base class - Web Application - Links RazorEngine, Custom Assembly, contains .cshtml template files
All cshtml files have the following @inherits directive:
@inherits View<SomeModel>
An error is issued:
View namespace type not found, are you missing assembly reference?
My web.config contains the following entry:
<add namespace="CustomAssembly.NamespaceContainingViewClass" />
I think this has something to do with another <assemblies> entry where my CustomAssembly not mentioned. This is true? Can I compile my own base class, which is contained in another assembly?
ps I canβt get a strong name for the assembly, because my custom assembly refers to the assembly of the 3d batch, which is not very named either ...
Stacktrace:
at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context) at RazorEngine.Templating.TemplateService.CreateTemplate(String template, Type modelType) at RazorEngine.Templating.TemplateService.GetTemplate(String template, Type modelType, String name) at RazorEngine.Templating.TemplateService.Compile(String template, Type modelType, String name) at RazorEngine.Razor.Compile(String template, Type modelType, String name)
source share