I've developed an extension that references a .Net dll. This dll dynamically loads another dll (unmanaged) according to the hosting environment (x86 or x64). I've added both versions of the unmanaged dll, each in its own subfolder (x86 and x64), as resources to my extension, and set their deploy action to "Copy to Binaries directory".
The problem is that the deployment doesn't create the x86 and x64 subfolders, and when the .Net dll searchs for the umnanaged dll in those subfolders, it doesn't find them and fails.
Is there a way to keep the folder structure when deploying the resources?
I don't think what you want is possible. If possible, I would change the extension you developed to look for a specific file (e.g. with a xxx_x86 vs xxx_x64 filename), instead of a file in a subdirectory. If that somehow doesn't work for you, and you use that extension only in a single eSpace (if not, you could create a wrapper eSpace), you might (and I'm a bit brainstorming here, not sure if it would work in practice) include the DLLs in the eSpace instead, and deploy them to a specific target directory. Iirc, you can specify any directory, and the Platform will create it (though my memory is rusty).
Kilian Hekhuis wrote:
Adding the DLLs as eSpace resources solved the problem. You can indeed specify any target directory you want, including multiple leves. In my case, I needed the DLLs to be in subdirectories of the "Bin2" folder, so all I had to do was to specify "Bin2\x64" as the target directory for the resource.
Thank you very much!
You're welcome, glad I could be of help :).