I have Umbraco v6.1.6 (Assembly version: 1.0.5021.24867) installed and running.
I noticed I have 2 different Json assemblies on the /bin directory of the application:
Newtonsoft.Json.Net20.DLL and
Newtonsoft.Json.Net.DLL
I'm trying to use Json.Net on a brand new script file and as soon as I add:
@using Newtonsoft.Json;
And try to use the JsonConvert method it gives me the error below:
c:\inetpub\wwwroot\MacroScripts\635332037414785257_aaa.cshtml(155): error CS0433: The type 'Newtonsoft.Json.JsonConvert' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e22c2559\92c7e946\assembly\dl3\eaf1ce99\490bebab_9c17cf01\Newtonsoft.Json.Net20.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e22c2559\92c7e946\assembly\dl3\e0166b8a\335e5988_cf2dcf01\Newtonsoft.Json.DLL'
I tried removing the old version but the XSLT stops working. I tried removing the new version, the whole site stopped working (500 errors).
Trying to use Json on a script file should be a pretty common scenario. Has anyone had this problem? Any ideas on how to solve it?
Multiple versions of Json.net
Hello all,
I have Umbraco v6.1.6 (Assembly version: 1.0.5021.24867) installed and running.
I noticed I have 2 different Json assemblies on the /bin directory of the application:
Newtonsoft.Json.Net20.DLL and
Newtonsoft.Json.Net.DLL
I'm trying to use Json.Net on a brand new script file and as soon as I add:
@using Newtonsoft.Json;
And try to use the JsonConvert method it gives me the error below:
c:\inetpub\wwwroot\MacroScripts\635332037414785257_aaa.cshtml(155): error CS0433: The type 'Newtonsoft.Json.JsonConvert' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e22c2559\92c7e946\assembly\dl3\eaf1ce99\490bebab_9c17cf01\Newtonsoft.Json.Net20.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e22c2559\92c7e946\assembly\dl3\e0166b8a\335e5988_cf2dcf01\Newtonsoft.Json.DLL'
I tried removing the old version but the XSLT stops working. I tried removing the new version, the whole site stopped working (500 errors).
Trying to use Json on a script file should be a pretty common scenario. Has anyone had this problem? Any ideas on how to solve it?
Thanks,
Fernando
I've never heard of the .Net20.DLL.. Not sure where that might've come from.
Try adding this to web.config (in runtime\assemblyBinding):
HI Sebastian,
I tried your code but it did not work.
I figured our there that DLL is coming from:
http://our.umbraco.org/projects/developer-tools/xsltojson
This project bundles the DLL. I'm going to dig into it to see if I can make it use the "normal" Json DLL.
Thanks,
Fernando
is working on a reply...