1

Sorry, I'm not sure how to name this question.

I am busy with Sagem SDK development, and I have a bit of a problem now. The way the SDK works is that you can either use one set of assemblies without a Sagem VERIF dongle, of the other set with the dongle. Both these sets of assemblies ([Sagem.MorphoKit, Sagem.MorphoKit.AcquisitionComponent], [Morpho.MorphoAcquisition, Morpho.MorphoSmart]) use C++ Dll's to communicate with the actual biometric device. The thing that they didn't do though is use the same ones. So the MORPHO_SDK.dll for the one is different from the other.

Is there a way to load the assemblies from separate folders, and execute the assembly in that folder. The Assembly resolver helps me setting the path, but the moment I load the assembly it can't find the dependencies, because the files exists in the folder and not in the executing assembly folder.

I hope this is clear, if you need anymore information please ask. I will clarify as far as I can.

Alexander Zhak
  • 9,140
  • 4
  • 46
  • 72
Jaques
  • 2,215
  • 1
  • 18
  • 35
  • Have you seen this?: http://stackoverflow.com/questions/1373100/how-to-add-folder-to-assembly-search-path-at-runtime-in-net – Jon Egerton Apr 28 '15 at 10:03
  • I did, and that is what I tried, the problem as far as I can figure out at least is that it tries to load that one assembly from the path and expects the dependencies for that assembly to be in the executing path of the application, and throws an exception `A procedure imported by 'Morpho.MorphoSmart.dll' could not be loaded` So what I need to get right if possible is to let the CLR know that this assembly must execute from that specific folder I specified. – Jaques Apr 28 '15 at 12:22
  • Could you turn it around a little - set the main working folder to your dependencies folder, then handle the missing .Net assemblies using those techniques? – Jon Egerton Apr 28 '15 at 12:40
  • @Jon, if I copy the appropriate dependencies into the folder for the ones I'm going to use, it works, but If i uncheck the box at runtime, it doesn't because it is looking for the other dependencies. Does it make sense. Sorry I don't always express myself good enough sometimes – Jaques Apr 28 '15 at 13:06
  • Oh and Jon, it is not missing .net assemblies. It is c++ dll's that is in the same folder as the .net assemblies, and it is the c++ Dll's that is ambiguous. – Jaques Apr 28 '15 at 13:50
  • I know its not missing .Net stuff at the moment, but I thought you could turn the problem around and make that the issue, so that its more easily solved, by making the main working path for the application the one your c++ dependencies are in - these should then load but you'd have problems with .Net, which can in turn be overcome using the techniques discussed. – Jon Egerton Apr 28 '15 at 13:52
  • Ok, I will try. Is it possible to change your working path in runtime? If this work the 2 sets of c++ Dll's still sits in two different folders – Jaques Apr 28 '15 at 14:46

0 Answers0