I am creating a browser plugin using the FireBreath Framework. Most of the logic is written in C # and to call from the browser I created a C ++ wrapper. Browsers are called C ++. The source code that invokes the "proxy" managed C ++ code, which invokes the real logic in a C # project.
So I have 3 dlls:
- Start a native C ++ dll, which depends on managed C ++;
- Managed C ++, which depends on C #;
- C # dll that contains the core logic.
All 3 DLLs installed in the user directory (c: \ Users \\ AppData \ Roaming \ MyCompany \ MyApp \ 1.0.0.0)
The problem is that the browser does not load the C # dll. I use the Side by Side manifest to declare dependencies.
I tried to create a separate manifest file for the assembly declaration:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity name="MyAssembly" processorArchitecture="*" type="win32" version="1.0.0.0"/> <file name="FirstDependency.dll"/> <file name="SecondDependency.dll"/> </assembly>
and added a link to this dependency to the main dll (Native C ++):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity name="MyAssembly" processorArchitecture="*" type="win32" version="1.0.0.0"/> </dependentAssembly> </dependency> </assembly>
Also I tried to declare the dependency directly in the dll head (Native C ++):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <file name="FirstDependency.dll"/> <file name="SecondDependency.dll"/> </assembly>
Tried to bind dependent dlls using the #pragma directive:
#pragma comment(linker, "\"/manifestdependency:type='win32' name='FirstDependency' version='1.0.0.0' processorArchitecture='X86' language='*'\"") #pragma comment(linker, "\"/manifestdependency:type='win32' name='SecondDependency' version='1.0.0.0' processorArchitecture='X86' language='*'\"")
I checked the dependencies using Dependency Walker and confirmed that the dependency between Managed C ++ and C # does not exist.
The plugin has access to the host dll (Native C ++), and it also loads Managed C ++, but when Managed C ++ causes the C # dll to fail, the plugin, the C # assembly cannot be found.
If I put C # dll in the same directory using a browser application (firefox.exe or chrome.exe) - it works.
It seems that the dependency between sites does not work between managed C ++ and C #.
How can I load dependent dlls for my plugin?