How to define per-GHA loading mechanism? - Grasshopper2024-03-29T08:08:07Zhttps://www.grasshopper3d.com/forum/topics/how-to-define-per-gha-loading-mechanism?feed=yes&xn_auth=noAh indeed. With _GrasshopperD…tag:www.grasshopper3d.com,2017-07-07:2985220:Comment:17805182017-07-07T15:14:09.186ZVicente Solerhttps://www.grasshopper3d.com/profile/VicenteSoler
<blockquote><p><span>Ah indeed. With _GrasshopperDeveloperSettings Memory Load option enabled and the load mechanism set to Plugin Default, the plugin doesn't win. That's clearly a bug.</span></p>
<p></p>
</blockquote>
<p></p>
<p><span>Was this bug ever fixed? I'm running into the same issue.</span></p>
<blockquote><p><span>Ah indeed. With _GrasshopperDeveloperSettings Memory Load option enabled and the load mechanism set to Plugin Default, the plugin doesn't win. That's clearly a bug.</span></p>
<p></p>
</blockquote>
<p></p>
<p><span>Was this bug ever fixed? I'm running into the same issue.</span></p> Great!tag:www.grasshopper3d.com,2015-01-27:2985220:Comment:12121042015-01-27T08:49:21.774ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
Great!
Great! Success! Recompiling as a DLL…tag:www.grasshopper3d.com,2015-01-27:2985220:Comment:12120702015-01-27T02:16:39.445ZAndrew Heumannhttps://www.grasshopper3d.com/profile/AndrewHeumann
<p>Success! Recompiling as a DLL did the trick. A thousand thanks.</p>
<p>Success! Recompiling as a DLL did the trick. A thousand thanks.</p> Thanks for chasing this down…tag:www.grasshopper3d.com,2015-01-27:2985220:Comment:12119682015-01-27T00:33:32.454ZAndrew Heumannhttps://www.grasshopper3d.com/profile/AndrewHeumann
Thanks for chasing this down so relentlessly. I will try to figure out how to refactor the code I need into a dll before I go down the route of resolving the assembly myself. I'm relying on the visual studio WPF app template, which nicely handles translating xaml into c# code for execution - my previous tries at creating a DLL instead of an exe didn't bear fruit but I should probably revisit it. Again - greatly appreciate all your help working through this!!!
Thanks for chasing this down so relentlessly. I will try to figure out how to refactor the code I need into a dll before I go down the route of resolving the assembly myself. I'm relying on the visual studio WPF app template, which nicely handles translating xaml into c# code for execution - my previous tries at creating a DLL instead of an exe didn't bear fruit but I should probably revisit it. Again - greatly appreciate all your help working through this!!! I presume this is the error t…tag:www.grasshopper3d.com,2015-01-26:2985220:Comment:12118832015-01-26T20:43:17.742ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>I presume this is the error then...</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2768950360?profile=original" style="font-size: 13px;" target="_self"><img class="align-full" src="http://storage.ning.com/topology/rest/1.0/file/get/2768950360?profile=RESIZE_1024x1024" width="721"></img></a></p>
<p></p>
<p></p>
<p>And I understand the problem now I think. We (McNeel) don't look for exe files when resolving references. Only libraries (dll, rhp, gha).</p>
<p></p>
<p>The system clearly does look for exe files, which is why it works if the gha is loaded from the disk, because then it's the system…</p>
<p>I presume this is the error then...</p>
<p><a href="http://storage.ning.com/topology/rest/1.0/file/get/2768950360?profile=original" target="_self" style="font-size: 13px;"><img width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2768950360?profile=RESIZE_1024x1024" width="721" class="align-full"/></a></p>
<p></p>
<p></p>
<p>And I understand the problem now I think. We (McNeel) don't look for exe files when resolving references. Only libraries (dll, rhp, gha).</p>
<p></p>
<p>The system clearly does look for exe files, which is why it works if the gha is loaded from the disk, because then it's the system finding the assembly.</p>
<p></p>
<p>It is uncommon for code to reference an executable, especially if you write the exe there's no reason at all to go down this road. See the first answer to <a href="http://stackoverflow.com/questions/22835635/is-it-a-bad-practice-to-reference-an-exe-file-in-c-sharp-project" target="_blank">this post</a> for some reason why it's a bad idea.</p>
<p></p>
<p>I'm uncomfortable making a change to RhinoCommon so it starts to resolve exes as well. I'll need to talk to Steve about that, but I'd rather we didn't do it at all. </p>
<p></p>
<p>If you really, really want to reference an exe, maybe you should handle the <a href="https://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve%28v=vs.110%29.aspx" target="_blank">AssemblyResolve event</a> yourself. <a href="https://msdn.microsoft.com/en-us/library/ff527268(v=vs.110).aspx" target="_blank">Further info</a>.</p> The main component that fails…tag:www.grasshopper3d.com,2015-01-26:2985220:Comment:12116752015-01-26T17:49:40.606ZAndrew Heumannhttps://www.grasshopper3d.com/profile/AndrewHeumann
The main component that fails is "launch window" - try setting the first parameter to true. If it's working a WPF dialog will appear on screen.
The main component that fails is "launch window" - try setting the first parameter to true. If it's working a WPF dialog will appear on screen. It's as though the flag is be…tag:www.grasshopper3d.com,2015-01-26:2985220:Comment:12116732015-01-26T17:00:31.722ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<blockquote><p><span>It's as though the flag is being ignored entirely.</span></p>
<p></p>
</blockquote>
<p><span>Ah indeed. With _GrasshopperDeveloperSettings Memory Load option enabled and the load mechanism set to Plugin Default, the plugin doesn't win. That's clearly a bug.</span></p>
<p></p>
<p><span>However I can still can't make it fail either way. Do I have to do anything else beyond just dropping a few of those components onto the canvas?</span></p>
<blockquote><p><span>It's as though the flag is being ignored entirely.</span></p>
<p></p>
</blockquote>
<p><span>Ah indeed. With _GrasshopperDeveloperSettings Memory Load option enabled and the load mechanism set to Plugin Default, the plugin doesn't win. That's clearly a bug.</span></p>
<p></p>
<p><span>However I can still can't make it fail either way. Do I have to do anything else beyond just dropping a few of those components onto the canvas?</span></p> I don't get any errors while…tag:www.grasshopper3d.com,2015-01-26:2985220:Comment:12115602015-01-26T16:54:11.397ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>I don't get any errors while loading the GHA nor while adding any of the (iconless) components to the canvas.</p>
<p>I don't get any errors while loading the GHA nor while adding any of the (iconless) components to the canvas.</p> When you say it works all the…tag:www.grasshopper3d.com,2015-01-26:2985220:Comment:12115472015-01-26T14:28:17.617ZAndrew Heumannhttps://www.grasshopper3d.com/profile/AndrewHeumann
<p>When you say it works all the time - you mean the launch window component functions without error? Or you're able to reproduce the issue I was having?</p>
<p></p>
<p>And to answer your question (if I understand correctly) - when I'm running (with COFF loading off entirely for all plugins) I'm unable to delete HumanUI.gha or any of its associated Dlls. With COFF loading enabled (left to each component/preferences to decide) I AM able to delete the GHA, despite the "forcedirect" flag. It's as…</p>
<p>When you say it works all the time - you mean the launch window component functions without error? Or you're able to reproduce the issue I was having?</p>
<p></p>
<p>And to answer your question (if I understand correctly) - when I'm running (with COFF loading off entirely for all plugins) I'm unable to delete HumanUI.gha or any of its associated Dlls. With COFF loading enabled (left to each component/preferences to decide) I AM able to delete the GHA, despite the "forcedirect" flag. It's as though the flag is being ignored entirely. </p> Well, I'm not getting anywher…tag:www.grasshopper3d.com,2015-01-26:2985220:Comment:12114962015-01-26T14:19:30.081ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Well, I'm not getting anywhere quick. The assembly you posted has ForceDirect as a flag, but no matter what settings I pick for Grasshopper application wide loading scheme or if I override the loading of Human via the Preferences, it seems to work all the time.</p>
<p></p>
<p>Can you confirm that the required dlls are in fact in the same folder as the HumanUI.gha file that gets loaded? The GHA should be locked while Grasshopper is running (you shouldn't be able to rename or delete it), in…</p>
<p>Well, I'm not getting anywhere quick. The assembly you posted has ForceDirect as a flag, but no matter what settings I pick for Grasshopper application wide loading scheme or if I override the loading of Human via the Preferences, it seems to work all the time.</p>
<p></p>
<p>Can you confirm that the required dlls are in fact in the same folder as the HumanUI.gha file that gets loaded? The GHA should be locked while Grasshopper is running (you shouldn't be able to rename or delete it), in case you need to make sure you've got the right one.</p>