Mike wrote:
>
> The application (DBAuthTest.exe) is sitting in a directory,
This is on your machine, right?
> the DLL
> (DBAuth.dll) is in another directory (not a subdirectory of where
> DBAuthTest.exe is).
OK, risky, but it is possible.
> In the directory with DBAuthTest.exe, I have DBAuthTest.exe.config,
> which contains:
>
> -------------snip---------------
> <configuration>
> <runtime>
> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
> <dependentAssembly>
> <assemblyIdentity name="DBAuth"
> publicKeyToken="c7d47cb0d27711c5"
> culture="neutral" />
> <codeBase version="1.1.1.1"
> href="file:///c:/dllpath/DBAuth.dll" />
> </dependentAssembly>
> </assemblyBinding>
> </runtime>
> </configuration>
> --------------snip-------------
>
>
> When I execute DBAuthTest.exe, I get an uncaught exception, here's the
> results from that window:
>
>
> -------------begin----------------
> See the end of this message for details on invoking
> just-in-time (JIT) debugging instead of this dialog box.
>
> ************** Exception Text **************
> System.IO.FileNotFoundException: Could not load file or assembly
> 'DBAuth, Version=1.1.1.1, Culture=neutral, PublicKeyToken=null' or one
> of its dependencies. The system cannot find the file specified.
> File name: 'DBAuth, Version=1.1.1.1, Culture=neutral,
> PublicKeyToken=null'
Oops! This is a different file, the name of the file you mention in the
config file is
DBAuth, Version=1.1.1.1, Culture=neutral,
PublicKeyToken=c7d47cb0d27711c5
1) has DBAuth been signed?
2) have you compiled DBAuthTest against the signed DBAuth?
> Funny thing is, when I remove the publickeytoken item from the config
> file, it looks like it actually finds the DLL file, just chokes on the
> public key not being right. Here's the difference in the error
> message from when that happens.
The file *must* be signed if you want it to be in a folder that is not
under the app folder.
> LOG: Attempting download of new URL file:///c:/dllpath/DBAuth.dll.
> WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY
> TOKEN
> ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
> terminated.
>
> It's odd that it attempts to download the dll when there's no public
> key specified in the config file, but seems to ignore the config file
> (or the dll) when the public key token is specified.
I agree, this should not happen.
> Any help or point in the right direction would be, again, greatly
> appreciated.
Sign the library and build the process against the signed library. Once
you have done that you need to set up code access security to allow the
library to be executed. Details of all of this can be found in my
tutorials (see my sig).
Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm