bindingRedirect and COM-interop
- From: "Thomas Israelsen" <ti@xxxxxxxxxxx>
- Date: 30 Mar 2005 14:42:33 -0800
I have two different versions of an assembly (3.2.3.0 and 3.3.0.0).
Both are registered for com-interop (by building them with Visual
Studio). They are in separate directories.
I have an unmanaged executable which I want to have use the older
version (3.2.3.0) of the assembly via com-interop. I've verified that
two separate keys are present under InprocServer32 in the registry -
one for each version of the assembly. Under each of these keys the
correct codebase value is present.
My executable is CppTestClient.exe, so I created
CppTestClient.exe.config and placed in the same directory. The file
looks like this:
<?xml version ="1.0?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FleetViewClient"
publicKeyToken="5ba74f079946f741"/>
<bindingRedirect oldVersion="3.3.0.0"
newVersion="3.2.3.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
When I run the executable it fails, since it expects to find a method
which is not present in the newer assembly (I assume).
The logs from FUSLOGVW.exe (see below) suggest that the config-file is
ignored, since they look the same whether the config-file is there or
not. If i try using the config file on a managed executable, the
redirection works like a charm.
I think it's supposed to work with unmanged executables. Phil Wilson
has a section on it in his execellent book "Definitive guide to Windows
Installer" and this article also describes it:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconfiguringcomapplicationforside-by-sideexecution.asp
Any suggestions?
*** Assembly Binder Log Entry (31-03-2005 @ 00:24:13) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable
C:\Dev\rapidis_vss\Products\FleetViewGeoServices\FleetViewClientSDK\Deployment\CppTestClient\Debug\CppTestClient.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: Where-ref bind. Location =
C:/Dev/rapidis_vss/Sager/FkPostal/Udvikling/FleetViewGeoServices/FleetViewDemo/Development/FleetViewClient/bin/Debug/FleetViewClient.dll
LOG: Appbase =
C:\Dev\rapidis_vss\Products\FleetViewGeoServices\FleetViewClientSDK\Deployment\CppTestClient\Debug\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: Processing DEVPATH.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL
file:///C:/Dev/rapidis_vss/Sager/FkPostal/Udvikling/FleetViewGeoServices/FleetViewDemo/Development/FleetViewClient/bin/Debug/FleetViewClient.dll.
LOG: Assembly download was successful. Attempting setup of file:
C:\Dev\rapidis_vss\Sager\FkPostal\Udvikling\FleetViewGeoServices\FleetViewDemo\Development\FleetViewClient\bin\Debug\FleetViewClient.dll
LOG: Entering run-from-source setup phase.
--------------------------------------------------------------
*** Assembly Binder Log Entry (31-03-2005 @ 00:21:50) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file
specified.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable
C:\Dev\rapidis_vss\Products\FleetViewGeoServices\FleetViewClientSDK\Deployment\CppTestClient\Debug\CppTestClient.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = FleetViewClient, Version=3.3.0.0, Culture=neutral,
PublicKeyToken=5ba74f079946f741
(Fully-specified)
LOG: Appbase =
C:\Dev\rapidis_vss\Products\FleetViewGeoServices\FleetViewClientSDK\Deployment\CppTestClient\Debug\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: FleetViewClient, Version=3.3.0.0,
Culture=neutral, PublicKeyToken=5ba74f079946f741
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL
file:///C:/Dev/rapidis_vss/Products/FleetViewGeoServices/FleetViewClientSDK/Deployment/CppTestClient/Debug/FleetViewClient.DLL.
LOG: Attempting download of new URL
file:///C:/Dev/rapidis_vss/Products/FleetViewGeoServices/FleetViewClientSDK/Deployment/CppTestClient/Debug/FleetViewClient/FleetViewClient.DLL.
LOG: Attempting download of new URL
file:///C:/Dev/rapidis_vss/Products/FleetViewGeoServices/FleetViewClientSDK/Deployment/CppTestClient/Debug/FleetViewClient.EXE.
LOG: Attempting download of new URL
file:///C:/Dev/rapidis_vss/Products/FleetViewGeoServices/FleetViewClientSDK/Deployment/CppTestClient/Debug/FleetViewClient/FleetViewClient.EXE.
LOG: All probing URLs attempted and failed.
.
- Prev by Date: Re: Is there any way to hack around C#'s lack of support for optional arguments?
- Next by Date: Re: Is there any way to hack around C#'s lack of support for optional arguments?
- Previous by thread: Variant containing SAFEARRAY problems
- Next by thread: Re: Excel Automation
- Index(es):
Relevant Pages
|