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: Unable to compile template. The predefined type
System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition from
mscorlib.dll'
However the code works just fine on my Windows machine. Am I missing something obvious, or does this simply not work on Mono?
[Edit]
I just found this information in the "Errors" property of the exception.
{'Line': '0', 'Column': '0', 'ErrorNumber': 'CS1685', 'IsWarning': 'True', 'ErrorText': 'The predefined type
System.Collections.Generic.IReadOnlyList' is defined multiple times. Using definition from
mscorlib.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 typeSystem.Collections.Generic.IReadOnlyCollection' is defined multiple times. Using definition from
mscorlib.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': ''}
I found this https://askubuntu.com/questions/315713/trouble-compiling-monodevelop-4-on-ubuntu-12-04
And it had me thinking of how I installed Mono. I installed from a gz file, and then from Git (to get the latest version), which ultimately gave me two copies. Unfortunately I cannot install directly from Git (as it requires Mono installed to be able to build...). So I just reversed to the gz, and the issue was automatically resolved!
So basically, two instances of Mono existed at the same time (somehow), and RazorEngine was the first thing to point this out to me (yet everything else worked just fine).