DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.73k stars 632 forks source link

errors when loading assemblies/references that are already loaded. #7798

Open ksobon opened 7 years ago

ksobon commented 7 years ago

Dynamo version

1.2.1

Operating system

Windows 10

What did you do?

Open Dynamo

What did you expect to see?

Load package references without errors.

What did you see instead?

This: https://github.com/BadMonkeysTeam/Mandrill/issues/32

Again, the issue here is that Dynamo Player already loads a version of EO.WebBrowser DLL, and that causes it to fail, when I load a version of it from Mandrill.

I guess what I am asking for is to just dismiss the errors caused by the fact that some other package already loaded this DLL into the context. Why does it bubble up? Did I miss something?

Cheers!

mjkkirschner commented 7 years ago

@ksobon is this the same issue? https://github.com/DynamoDS/Dynamo/issues/7369

ksobon commented 7 years ago

I don't think so because @teocomi reports that his package would not show in Dynamo and that it was related to name of his package. What happens here is that Revit loads EO.WebBrowser dlls before Dynamo gets loaded and subsequently Mandrill package. By the time Mandrill starts loading Dlls for its references there is already a version of EO.WebBrowser loaded by DynamoPlayer, so it just reports an error at this point. Luckily there wasn't any breaking changes between the version that Player loaded and what Mandrill needs so I had no issues, but its annoying.

mjkkirschner commented 7 years ago

Ahh, okay, yeah, perhaps we can approve this - these warnings were added because a bunch of revit addins were causing issues with Dynamo with other dependencies and we wanted some way to help users figure out what addin was causing the issue, the warnings should not appear if both assemblies are loaded with semantically compatible versions.

ksobon commented 7 years ago

It claims they are not compatible: image The only thing that I know of in Revit that was added to version 2017.1 and uses Chrome was Dynamo Player so I am guessing that's what is also loading the EO.WebBrowser.

mjkkirschner commented 7 years ago

do you know what version revit is loading?

ksobon commented 7 years ago

No idea. Is there a way to check that?

mjkkirschner commented 7 years ago

module window in visual studio maybe?

johnpierson commented 6 years ago

@ksobon is this how you went ahead and solved this? http://archi-lab.net/encapsulating-addins-with-costura-fody/ if so, cool! Although, it would still be great to see a solution in Dynamo itself.

ksobon commented 6 years ago

@johnpierson that's the idea, but I haven't tried Mandrill yet. I will give it a go, and report back.

ksobon commented 6 years ago

@johnpierson the answer is no. sorry mate, this particular issue still persists. I also realized that fody is not a solution here by looking at their source code. it appears that they first check if assembly was loaded already, and only then do they look for assemblies in the local resources that were embedded. That kind of sucks. I thought they were able to encapsulate that context to only use embedded assemblies. Anyways, i will keep looking.

mjkkirschner commented 6 years ago

@kronz @Dewb fyi

michaldengusiak commented 4 years ago

@mjkkirschner I have the same issue right now and trying to see if anyone found any solution? I am using Dynamo 2.3.0,

I am using Topologic package and we use SAM_Topologic and can not load both at the same time. It is working fine with Grasshopper but we are unable to get it working with Dynamo. Seems like an old issue that was not addressed yet. I would really appreciate your help,

image

mjkkirschner commented 4 years ago

what is sam topologic? This issue doesn't seem exactly the same- your exception indicates that the assembly failed to import into the VM - perhaps asking here is more efficient: https://github.com/NonManifoldTopology/Topologic

mjkkirschner commented 4 years ago

can you also explain your repro steps exactly? If you don't load topologic package - everything works fine with your code?

mjkkirschner commented 4 years ago

I've found your repo and have a couple ideas -

  1. Can you try packaging your library as a dynamo package instead of importing with zeroTouch (if thats how you are importing it)
  2. You can avoid shipping the topologioc.dlls if you require your users to install topologic first.

I believe we tried to address this type of case in 2.3 though, but our fixes there may only help if both node assemblies are imported as parts of packages. @aparajit-pratap FYI

    • you can try removing topologic types from your Dynamo zt functions - ie - just use object as your parameter type instead - this will potentially avoid importing the topologic types into the VM. It's kind of a workaround but worth a shot I think.