在Mono v2.10上使用RazorEngine v3

时间:2012-08-24 19:42:16

标签: .net mono razorengine

有没有办法在Mono v2.10上使用RazorEngine v3?

尝试解析模板时出现以下错误。

TypeLoadException: A type load exception has occurred.
  at RazorEngine.Templating.TemplateService.CreateTemplateType (System.String razorTemplate, System.Type modelType) [0x00000] in <filename unknown>:0 
  at RazorEngine.Templating.TemplateService.CreateTemplate[<>f__AnonymousType0`2] (System.String razorTemplate, .<>f__AnonymousType0`2 model) [0x00000] in <filename unknown>:0 
  at RazorEngine.Templating.TemplateService.Parse[<>f__AnonymousType0`2] (System.String razorTemplate, .<>f__AnonymousType0`2 model) [0x00000] in <filename unknown>:0 
  at RazorEngine.Razor.Parse[<>f__AnonymousType0`2] (System.String razorTemplate, .<>f__AnonymousType0`2 model) [0x00000] in <filename unknown>:0 

1 个答案:

答案 0 :(得分:0)

TL / DR:更新为Mono 3.x。

长篇小说:在Mono 2.10.x发布时,微软还没有完全发布ASP.NET堆栈作为开源(Razor是仍然是封闭源代码的组件之一)。

最近微软终于开源了整个堆栈,Mono将它包含在他们的树中,但是这发生在2.10发布之后,并且不会被反向移植。

更长的故事:http://tirania.org/blog/archive/2012/Mar-28.html