I'm pretty sure the answer is no but just in case:
For a stand alone exe with an appropriate SxS manifest, is it possible to reference COM DLL's using a relative path or load them from a directory that is not the current directory?
We're operating in a grid environemnt that deploys various packages (i.e. zip files) using a common folder as the root. Several apps would like to reference a common COM Api (with DLL manifests) from a common location. However, as the grid environment is sandboxed we can't install to the Windows SxS directory and we also can't do it out of band (i.e. not deployed by the grid).
Do I have any hope of saying load COM.DLL from ..\SomeCommonDir\COM.dll or C:\Program Files\SomeCommonDir\COM.DLL ?
Everything works fine as a private assembly.
This should be possible using Activation Contexts. (I'm assuming that you OK with manifest etc as it sounds like you're able to get it working fine the 'standard' way...)
There's the 'hardcore' way of doing things here, or you can use the
Microsoft.Windows.ActCtx
object. These both allow you to manually / programmatically set the location of the client manifest for the Activation Context; the client manifest does have to be in the same folder as the assembly manifest and the assembly.This SO question may be of use to you. And here's a snippet of one way to do it...