My experience is that it does not work, or rather you need to go into the activation context API to actually use the manifest in the DLL: see this question: Move the manifest file to dll?
My attitude to this, although perhaps not entirely accurate, is this:
Only the executable manifest is always "in scope", if you have DLL files with parallel COM manifests, you force it to be explicitly loaded using the Activation Context API, and the problem is that it can only work when you are exactly You know when itβs necessary, and control the call path to the places in the DLL where necessary.
Because, as I understand it, what you really do when you have "a.exe.manifest (announces COM registration for c.dll)" is that you change the initial / global activation context for this process. This (looks like) only works for an executable manifest. Any manifests for DLLs will not be used automatically after loading the DLL, so you will have to do it manually when you need the COM-reg-free manifest, i.e. Before CoCreateInstance .
I had a case where I thought I knew when CoCreateInstance was called, and I needed a switch, but only later it turned out that the DLL spawned some stream (s) that they themselves used CoCreateInstance. (Where I could not control the activation context.)
So, to summarize, I would say:
- If you can do this at all, include the SxS COM manifest in the executable
- You can use the activation context API if you are fully aware, and you can control when you need to switch the context ("manually"), but this seems much more complicated than just embedding the manifest in the executable.
source share