01-25-2017 09:56 AM
Hello all,
i'm quite new to Geomedia programming, maybe my question is trivial, but i couldn't find an answer:
I have a quite large C# WPF-application and haveto integrate it with Geomedia. I've managed to create acustom command, register taht command and have it deployed into Geomedia. As a result, there's now a new tab with my new command and when i click it, my programcode starts to run.
Now i have one problem:
My C#-code results in approx. 50 separate dll's which i allput into the path which i also specfiied in the registration command.
But whenever code goes to one of the dependent dll's, that code is not found. It seems Geomedia does not search the path for dependent dll's. When i copy all my dl's into the program-path where geomedia.exe resists, the application runs, but that's of course not a solutio.
So here my question:
Can i specify the path, where cutom command have put additional Dll's which have to dynamically loaded?
Thanks in advance,
Andreas
01-25-2017 10:05 AM
Hello Andreas,
this is rather a general question about Windows OS and application, and you can find the answer on the internet. For example you can find some information here or here. However, you have basically two options:
Pavel
01-25-2017 10:58 AM
Hello Pavel,
thanks for your reply.
I know how to generally handle dll's and search-paths. But as a command is some kind of "Add-In" into geomedia i had hoped that there is also some kind of configuration possible for these commands. I've developed add-on's for CAD-systems which is quite similar to commands in Geomedia. There you can define a specific directory where the CAD-system should search for addon-specific dll's. This makes it possible to easily "configure" client-pc's without having to make full installation packages, which will be needed if you want to modify the registry and add the dll's to the Geomedia.exe settings.
Regards,
Andreas
01-25-2017 11:19 AM
Hello Andreas,
I am not aware of any such mechanism within GeoMedia. But if I look for example at GeoMedia Grid, which has lots of dlls in separate folder, the only path to this folder is in the resgistry under "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\GeoMedia Grid". So perhaps if all the dlls are .NET dlls, it might be sufficient to create similar entry in the registry. But I haven't tested that.
Pavel
01-26-2017 01:14 AM
If I recall correctly, the .NET Framework assembly probing logic looks in globally defined Assemby Folders and in the AppDomain's BaseDirectory and possibly any PrivatePaths added. The latter need to be sub-folders of the entry assembly, though, due to security reasons.
Pavel's answer about adding a registry entry is entirely correct, but if you don't want to manipulate the registry for your command, you might have some success by adding a bit of runtime logic to your extension as per: http://stackoverflow.com/questions/1373100/how-to-add-folder-to-assembly-search-path-at-runtime-in-n...