Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Kent 30 posts 54 karma points
    Jun 19, 2013 @ 22:42
    Kent
    0

    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.

  • Martin 181 posts 740 karma points
    Jun 21, 2013 @ 08:55
    Martin
    0

    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

  • Jesper Nielsen 141 posts 498 karma points
    Jun 21, 2013 @ 14:30
    Jesper Nielsen
    0

    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.

    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
    or 
    Add a <probing> element with the new location.
    Kind regards,
    Jesper

     

     

  • Kent 30 posts 54 karma points
    Jun 21, 2013 @ 17:31
    Kent
    0

    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:

      <dependentAssembly>
          <assemblyIdentity name="Google.Api.Maps.Service" />
        <codeBase href="bin\google\Google.Api.Maps.Service.dll" version="0.9.2.6262" />
      </dependentAssembly>

    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 ?

  • Martin 181 posts 740 karma points
    Jun 23, 2013 @ 13:45
    Martin
    0

    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

  • Kent 30 posts 54 karma points
    Jun 24, 2013 @ 16:13
    Kent
    0

    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!)

Please Sign in or register to post replies

Write your reply to:

Draft