RazorEngine on Mono-引发TemplateCompilationException [英] RazorEngine on Mono - TemplateCompilationException thrown

查看:60
本文介绍了RazorEngine on Mono-引发TemplateCompilationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Linux机器上正在运行Mono 3.3.0. 我正在尝试使用RazorEngine 3.3.0(来自NuGet).

I have Mono 3.3.0 running on my Linux box. I am trying to use RazorEngine 3.3.0 (from NuGet).

不幸的是,现在它抛出了该异常

Unfortunately it now throws this exception

System.Exception:无法编译模板.预定义类型 System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition from mscorlib.dll'

System.Exception: Unable to compile template. The predefined type System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition frommscorlib.dll'

但是,该代码在我的Windows计算机上正常工作. 我是否遗漏了明显的东西,或者这根本无法在Mono上使用?

However the code works just fine on my Windows machine. Am I missing something obvious, or does this simply not work on Mono?

我刚刚在异常的错误"属性中找到了此信息.

I just found this information in the "Errors" property of the exception.

{'Line':'0','Column':'0','ErrorNumber':'CS1685','IsWarning': 'True','ErrorText':'预定义类型 System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition from mscorlib.dll'','文件名':''} {'行':'0', '列':'0','错误号':'','IsWarning':'假','错误文本': '/usr/lib/mono/4.5/mscorlib.dll(与 先前的警告)','文件名':''} {'行':'0','列':'0', 'ErrorNumber':'','IsWarning':'False','ErrorText': '/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0_0738eb9f132ed756/fastcgi-mono-server4.exe (与先前警告相关的符号的位置)','文件名':''} {'Line':'0','Column':'0','ErrorNumber':'CS1685','IsWarning': 'True','ErrorText':'预定义类型 System.Collections.Generic.IReadOnlyCollection' is defined multiple times. Using definition from mscorlib.dll'','文件名':''} {'Line':'0','Column':'0','ErrorNumber':'','IsWarning':'False', 'ErrorText':'/usr/lib/mono/4.5/mscorlib.dll(符号的位置 与先前的警告有关)','Filename':''} {'Line':'0', '列':'0','错误号':'','IsWarning':'假','错误文本': '/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0_0738eb9f132ed756/fastcgi-mono-server4.exe (与先前警告相关的符号的位置)','Filename':''}

{'Line': '0', 'Column': '0', 'ErrorNumber': 'CS1685', 'IsWarning': 'True', 'ErrorText': 'The predefined type System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition frommscorlib.dll'', 'Filename': ''} {'Line': '0', 'Column': '0', 'ErrorNumber': '', 'IsWarning': 'False', 'ErrorText': '/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous warning)', 'Filename': ''} {'Line': '0', 'Column': '0', 'ErrorNumber': '', 'IsWarning': 'False', 'ErrorText': '/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0_0738eb9f132ed756/fastcgi-mono-server4.exe (Location of the symbol related to previous warning)', 'Filename': ''} {'Line': '0', 'Column': '0', 'ErrorNumber': 'CS1685', 'IsWarning': 'True', 'ErrorText': 'The predefined type System.Collections.Generic.IReadOnlyCollection' is defined multiple times. Using definition frommscorlib.dll'', 'Filename': ''} {'Line': '0', 'Column': '0', 'ErrorNumber': '', 'IsWarning': 'False', 'ErrorText': '/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous warning)', 'Filename': ''} {'Line': '0', 'Column': '0', 'ErrorNumber': '', 'IsWarning': 'False', 'ErrorText': '/usr/lib/mono/gac/fastcgi-mono-server4/3.0.0.0_0738eb9f132ed756/fastcgi-mono-server4.exe (Location of the symbol related to previous warning)', 'Filename': ''}

推荐答案

如果仅安装了一个Mono,请看一下我在这里描述的解决方案: 剃刀引擎在具有快速CGI的Mono 3.2.x上-目标特定的.net?

If you just have one Mono install, take a look at the solution I described here: Razor Engine on Mono 3.2.x with Fast CGI - target specific .net?

这篇关于RazorEngine on Mono-引发TemplateCompilationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆