有没有办法在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
答案 0 :(得分:0)
TL / DR:更新为Mono 3.x。
长篇小说:在Mono 2.10.x发布时,微软还没有完全发布ASP.NET堆栈作为开源(Razor是仍然是封闭源代码的组件之一)。
最近微软终于开源了整个堆栈,Mono将它包含在他们的树中,但是这发生在2.10发布之后,并且不会被反向移植。