Last post Apr 30, 2018 06:13 AM by Edward Z
Apr 27, 2018 09:48 AM|Wizardskills|LINK
I'm getting a odd error when using v3.2.3 of Razor. The below method is throwing the error:
"Unable to compile template. The predefined type 'System.Tuple' is defined in multiple assemblies in the global alias; using definition from 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll'
Other compilation errors may have occurred. Check the Errors property for more information."
public string Build(string ressourceName, object model)
return Razor.Resolve(ressourceName, model).Run(new ExecuteContext());
There is also this error in the errors property on the exception:
"The type 'System.Tuple' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll' and 'c:\Program Files (x86)\IIS Express\Microsoft.VisualStudio.Utilities.Internal.Net35.dll'"
Our project was recently upgraded to .Net v4.6.1 so I'm sure this is what has caused the issue, however I don't know how I can resolve it.
Does anyone have any ideas on how I can fix this?
Apr 30, 2018 06:13 AM|Edward Z|LINK
For this error, it seems you reference the “Tuple” dll in multiple assemblies. I suggest you search “Ssytem.Tuple” in the Solution explorer, and then remove the repeated dll.