uCommerce v3.6 exception on Google Maps API assembly
if Google.Api.Maps.Service.dll is in the bin directory (I'm using it on my site), uCommerce blows up. Can't access the umbraco backend at all and code that uses uCommerce API's throws an exception. If I build the app, then delete the dll from /bin...everything works (except my code that uses the dll, of course). Add it back (no re-compile) and it blows up again. What is going on?
The exception is 'Could not convert string 'UCommerce.Xslt.Rendering.IXmlRenderer`1[[UCommerce.EntitiesV2.Definitions.IProperty]], UCommerce' to a type'. Source is Castle.Windsor. But the inner exception is: "Method 'ReadJson' in type 'Google.Api.Maps.Service.JsonEnumTypeConverter' from assembly 'Google.Api.Maps.Service, Version=0.9.2.36598, Culture=neutral, PublicKeyToken=null' does not have an implementation."
EDIT: forgot to mention that this only became a problem once I upgraded umbraco to 6.1.1 and uCommerce to 3.6.1.13149. I believe this actually occurred after upgrading umbraco, but before upgrading ucommerce.
I haven't seen that error before. It seems somehow that Castle windsor scans the Google.Api.Maps.Service dll as well. I will try to recreate it later today and see what happens (unless somebody from uCommerce comes by and tells exactly whats wrong). Is the Google.Api.Maps.Service a public dll from Google? In that case can you link to it then I will take a look on it.
I have tried adding Google.Api.Maps.Service.dll and Newtonsoft.Json.dll assemblies to the bin folder. And it blows up. I get the same error as you, but in a slightly different context. I get the
Method 'ReadJson' in type 'Google.Api.Maps.Service.JsonEnumTypeConverter' from assembly 'Google.Api.Maps.Service, Version=0.9.2.6262, Culture=neutral, PublicKeyToken=null' does not have an implementation.
exception directly.
The cause of this exception is in my case not UCommerce.
What happens is that Umbraco scans the bin folder, and looks through all the assemblies found there and calls the "RuntimeAssembly.GetExportedTypes()" on them. This causes the exception. :-S Umbraco does this to find all the public classes that implements Umbraco stuff.
(You can try calling the RuntimeAssembly.GetExportedTypes() on the Newtonsoft.Json.dll assembly. I suspect it throws the exception.)
So one way of working around this could possibly be to put the dependencies in a sub folder to the bin folder.
Then add either a <dependantAssembly> to the web.config file with a "codebase" to the new location of the dependencies
Jesper - thank you for the explanation! Your solution looks like a good one. Unfortunately, I'm having some trouble getting it to work. I've created a subfolder (bin\Google\) and moved the dll there. I've also added the following to the web.config:
But when I rebuild, the dll is copied to the bin folder and that is what is apparently used. Any idea how I can tell it not to copy the dll and simply use the one in the subfolder ?
You can tell visual studio not to copy a local copy by finding your assembly in your solution explorer click F4 and then in the property window you find the attribute copy local and change it to "False". Then it should not be copied to your bin folder.
It seems that Jesper has caught the essence. It seems to be Umbraco causing this somehow.
I don't think you can do that with a web site project. I don't have the properties window option for any files in my umbraco project. I do for the class library projects in the solution.
Anyhow, I ended up just using a different Google Maps API assembly (from Nuget) and all is well (after a couple hours of refactoring my code, that is!)
uCommerce v3.6 exception on Google Maps API assembly
if Google.Api.Maps.Service.dll is in the bin directory (I'm using it on my site), uCommerce blows up. Can't access the umbraco backend at all and code that uses uCommerce API's throws an exception. If I build the app, then delete the dll from /bin...everything works (except my code that uses the dll, of course). Add it back (no re-compile) and it blows up again. What is going on?
The exception is 'Could not convert string 'UCommerce.Xslt.Rendering.IXmlRenderer`1[[UCommerce.EntitiesV2.Definitions.IProperty]], UCommerce' to a type'. Source is Castle.Windsor. But the inner exception is: "Method 'ReadJson' in type 'Google.Api.Maps.Service.JsonEnumTypeConverter' from assembly 'Google.Api.Maps.Service, Version=0.9.2.36598, Culture=neutral, PublicKeyToken=null' does not have an implementation."
EDIT: forgot to mention that this only became a problem once I upgraded umbraco to 6.1.1 and uCommerce to 3.6.1.13149. I believe this actually occurred after upgrading umbraco, but before upgrading ucommerce.
Hi Kent,
I haven't seen that error before. It seems somehow that Castle windsor scans the Google.Api.Maps.Service dll as well. I will try to recreate it later today and see what happens (unless somebody from uCommerce comes by and tells exactly whats wrong). Is the Google.Api.Maps.Service a public dll from Google? In that case can you link to it then I will take a look on it.
Best Regards Martin
Hi Kent,
I have tried adding
Google.Api.Maps.Service.dll and Newtonsoft.Json.dll assemblies to the bin folder. And it blows up. I get the same error as you, but in a slightly different context. I get the
Method 'ReadJson' in type 'Google.Api.Maps.Service.JsonEnumTypeConverter' from assembly 'Google.Api.Maps.Service, Version=0.9.2.6262, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Martin the Google dll can be found here: http://gmaps.codeplex.com/
Jesper - thank you for the explanation! Your solution looks like a good one. Unfortunately, I'm having some trouble getting it to work. I've created a subfolder (bin\Google\) and moved the dll there. I've also added the following to the web.config:
But when I rebuild, the dll is copied to the bin folder and that is what is apparently used. Any idea how I can tell it not to copy the dll and simply use the one in the subfolder ?
Hi Kent,
You can tell visual studio not to copy a local copy by finding your assembly in your solution explorer click F4 and then in the property window you find the attribute copy local and change it to "False". Then it should not be copied to your bin folder.
It seems that Jesper has caught the essence. It seems to be Umbraco causing this somehow.
Best regards Martin
I don't think you can do that with a web site project. I don't have the properties window option for any files in my umbraco project. I do for the class library projects in the solution.
Anyhow, I ended up just using a different Google Maps API assembly (from Nuget) and all is well (after a couple hours of refactoring my code, that is!)
is working on a reply...