I actually have two questions here, but I'll start by giving an outline
of what I'm trying to do.
I'm building an app with a simple plugin architecture (all in the same
app domain). I have each plugin in a separate sub-dir inside a
"Plugins" directory. Each plugin consists of at least two DLLs (a
controller and a driver). However, most drivers also rely on other
external DLLs.
In one particular case this dependency is to a C++ DLL called
PF_DTMF_Connector.dll which in turn is dependent on another C/C++ DLL
in the windows\system32 folder.
My first question is what this error message means and how can I
resolve it? When I dynamically load my driver DLL up for this
particular plugin I get the error message below. Note that if I include
my driver code as a normal project, I don't get this error. Also note
that although I do get this error, at least some of the functionality
of this DLL DOES work. This DLL is located right with the plugin using
it. Is this DLL having trouble finding it's dependent DLL that's in the
windows\system32 directory? If so, how would I correct this?
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection)
[Could not load file or assembly
'file:///C:\working\IQ\v6.0\DTMFTester\bin\Debug\Plugins\En umeration\PF_DTMF_Connector.dll'
or one of its dependencies. The module was expected to contain an
assembly manifest.] :
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile,
Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm
hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
My second question relates to another plugin I wrote. It's driver DLL
depends on another (managed) DLL. When I put this dependent DLL in the
same directory as the plugin, it can't find it. If I move this
dependent DLL to the root directory of the application it all works
fine. How can I get it to seach the directory that the plugin is in? I
tried using the <probeattribute in the app.config but without any
luck.
Any direction with either of these problems would greatly be
appreciated!
Dan