App.config file <bindingRedirect> problems

P

Peter Blum

I have built an assembly (dll) from which I expect third parties to
subclass. As a result, when my assembly has a version change, it will cause
any third party assembly based on it to break unless I establish a Publisher
Policy file. So I have that.

I have built a Windows app for the same product. This app prompts the user
for a path to a third party assembly that depends on my assembly. It opens
the third party assembly (Assembly.Load) and instantiates some of the
classes it contains. All of this works so long as the versions match between
my assembly and the third party assembly.

Instead of demanding that the user adds my assembly and its publisher policy
file to the GAC, I want my Windows app to offer an application config file
that handles version changes of my assembly. I cannot get this part to work.
Any ideas?

Details:
My assembly name: PeterBlum.VAM.dll, v0.9.2.1. Located in the same folder as
the Windows app. (The publisher policy file and its own config file is also
in the same folder although that doesn't seem to matter.)
Third party assembly name: PeterBlum.PDPToVAM.dll, compiled to use v0.9.2.0.
Windows app name: Import VAM Classes.exe
App config file: "Import VAM Classes.exe.config" located in the same folder
as the exe.
Config file contents:
<configuration>
<runtime>
<assemblyBinding xmlns:asm="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>
<assemblyIdentity name="PeterBlum.VAM"
publicKeyToken="76d6c019e89ec3c9"
culture=""/>
<bindingRedirect oldVersion="0.9.0.0-0.9.2.0"
newVersion="0.9.2.1"/>

</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

The Fusion log entry when Assembly.Load("[path]\PeterBlum.PDPToVAM.dll") is
executed:
The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\fusion.dll
Running under executable C:\Program Files\Professional Validation And More
v0.9.2\Support Applications\Import VAM Classes.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = PeterBlum.VAM, Version=0.9.2.0, Culture=neutral,
PublicKeyToken=76d6c019e89ec3c9
(Fully-specified)
LOG: Appbase = C:\Program Files\Professional Validation And More
v0.9.2\Support Applications\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : Import VAM Classes, Version=0.9.2.0, Culture=neutral,
PublicKeyToken=null.
===

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.0.3705\config\machine.config.
LOG: Post-policy reference: PeterBlum.VAM, Version=0.9.2.0, Culture=neutral,
PublicKeyToken=76d6c019e89ec3c9
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Professional
Validation And More v0.9.2/Support Applications/PeterBlum.VAM.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program
Files\Professional Validation And More v0.9.2\Support
Applications\PeterBlum.VAM.DLL
LOG: Entering run-from-source setup phase.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.


--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
 
Y

Yan-Hong Huang[MSFT]

Hello Peter,

I am looking for somebody who could help you on it. Thanks very much.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Peter Blum" <[email protected]>
!Subject: App.config file <bindingRedirect> problems
!Date: Sun, 20 Jul 2003 11:50:26 -0400
!Lines: 92
!Organization: www.PeterBlum.com
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <[email protected]>
!Newsgroups: microsoft.public.dotnet.general
!NNTP-Posting-Host: h0008021f4212.ne.client2.attbi.com 24.61.166.179
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:101869
!X-Tomcat-NG: microsoft.public.dotnet.general
!
!I have built an assembly (dll) from which I expect third parties to
!subclass. As a result, when my assembly has a version change, it will cause
!any third party assembly based on it to break unless I establish a
Publisher
!Policy file. So I have that.
!
!I have built a Windows app for the same product. This app prompts the user
!for a path to a third party assembly that depends on my assembly. It opens
!the third party assembly (Assembly.Load) and instantiates some of the
!classes it contains. All of this works so long as the versions match
between
!my assembly and the third party assembly.
!
!Instead of demanding that the user adds my assembly and its publisher
policy
!file to the GAC, I want my Windows app to offer an application config file
!that handles version changes of my assembly. I cannot get this part to
work.
!Any ideas?
!
!Details:
!My assembly name: PeterBlum.VAM.dll, v0.9.2.1. Located in the same folder
as
!the Windows app. (The publisher policy file and its own config file is also
!in the same folder although that doesn't seem to matter.)
!Third party assembly name: PeterBlum.PDPToVAM.dll, compiled to use
v0.9.2.0.
!Windows app name: Import VAM Classes.exe
!App config file: "Import VAM Classes.exe.config" located in the same folder
!as the exe.
!Config file contents:
!<configuration>
! <runtime>
! <assemblyBinding xmlns:asm="urn:schemas-microsoft-com:asm.v1">
!
! <dependentAssembly>
! <assemblyIdentity name="PeterBlum.VAM"
! publicKeyToken="76d6c019e89ec3c9"
! culture=""/>
! <bindingRedirect oldVersion="0.9.0.0-0.9.2.0"
! newVersion="0.9.2.1"/>
!
! </dependentAssembly>
! </assemblyBinding>
! </runtime>
!</configuration>
!
!The Fusion log entry when Assembly.Load("[path]\PeterBlum.PDPToVAM.dll") is
!executed:
!The operation failed.
!Bind result: hr = 0x80131040. No description available.
!
!Assembly manager loaded from:
!C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\fusion.dll
!Running under executable C:\Program Files\Professional Validation And More
!v0.9.2\Support Applications\Import VAM Classes.exe
!--- A detailed error log follows.
!
!=== Pre-bind state information ===
!LOG: DisplayName = PeterBlum.VAM, Version=0.9.2.0, Culture=neutral,
!PublicKeyToken=76d6c019e89ec3c9
! (Fully-specified)
!LOG: Appbase = C:\Program Files\Professional Validation And More
!v0.9.2\Support Applications\
!LOG: Initial PrivatePath = NULL
!LOG: Dynamic Base = NULL
!LOG: Cache Base = NULL
!LOG: AppName = NULL
!Calling assembly : Import VAM Classes, Version=0.9.2.0, Culture=neutral,
!PublicKeyToken=null.
!===
!
!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.0.3705\config\machine.config.
!LOG: Post-policy reference: PeterBlum.VAM, Version=0.9.2.0,
Culture=neutral,
!PublicKeyToken=76d6c019e89ec3c9
!LOG: Cache Lookup was unsuccessful.
!LOG: Attempting download of new URL file:///C:/Program Files/Professional
!Validation And More v0.9.2/Support Applications/PeterBlum.VAM.DLL.
!LOG: Assembly download was successful. Attempting setup of file: C:\Program
!Files\Professional Validation And More v0.9.2\Support
!Applications\PeterBlum.VAM.DLL
!LOG: Entering run-from-source setup phase.
!WRN: Comparing the assembly name resulted in the mismatch: Revision Number
!ERR: The assembly reference did not match the assembly definition found.
!ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
!terminated.
!
!
!--- Peter Blum
!www.PeterBlum.com
!Email: (e-mail address removed)
!
!
!
 
S

Suzanne Cook [MS]

If you always want to force your users to use the newest version, you may
want to consider keeping the assembly version the same and just changing the
file version, instead. See
http://blogs.gotdotnet.com/suzcook/PermaLink.aspx/cc6428d6-69fb-4f05-8f18-65f3eac85274
for other things to consider in that decision.

Suzanne Cook
My .NET CLR Loader blog: http://blogs.gotdotnet.com/suzcook/
--
Please do not respond directly to this alias. This alias is for newsgroup
purposes only. This posting is provided "AS IS" with no warranties, and
confers no rights.


Peter Blum said:
I have built an assembly (dll) from which I expect third parties to
subclass. As a result, when my assembly has a version change, it will cause
any third party assembly based on it to break unless I establish a Publisher
Policy file. So I have that.

I have built a Windows app for the same product. This app prompts the user
for a path to a third party assembly that depends on my assembly. It opens
the third party assembly (Assembly.Load) and instantiates some of the
classes it contains. All of this works so long as the versions match between
my assembly and the third party assembly.

Instead of demanding that the user adds my assembly and its publisher policy
file to the GAC, I want my Windows app to offer an application config file
that handles version changes of my assembly. I cannot get this part to work.
Any ideas?

Details:
My assembly name: PeterBlum.VAM.dll, v0.9.2.1. Located in the same folder as
the Windows app. (The publisher policy file and its own config file is also
in the same folder although that doesn't seem to matter.)
Third party assembly name: PeterBlum.PDPToVAM.dll, compiled to use v0.9.2.0.
Windows app name: Import VAM Classes.exe
App config file: "Import VAM Classes.exe.config" located in the same folder
as the exe.
Config file contents:
<configuration>
<runtime>
<assemblyBinding xmlns:asm="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>
<assemblyIdentity name="PeterBlum.VAM"
publicKeyToken="76d6c019e89ec3c9"
culture=""/>
<bindingRedirect oldVersion="0.9.0.0-0.9.2.0"
newVersion="0.9.2.1"/>

</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

The Fusion log entry when Assembly.Load("[path]\PeterBlum.PDPToVAM.dll") is
executed:
The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\fusion.dll
Running under executable C:\Program Files\Professional Validation And More
v0.9.2\Support Applications\Import VAM Classes.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = PeterBlum.VAM, Version=0.9.2.0, Culture=neutral,
PublicKeyToken=76d6c019e89ec3c9
(Fully-specified)
LOG: Appbase = C:\Program Files\Professional Validation And More
v0.9.2\Support Applications\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : Import VAM Classes, Version=0.9.2.0, Culture=neutral,
PublicKeyToken=null.
===

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.0.3705\config\machine.config.
LOG: Post-policy reference: PeterBlum.VAM, Version=0.9.2.0, Culture=neutral,
PublicKeyToken=76d6c019e89ec3c9
LOG: Cache Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Professional
Validation And More v0.9.2/Support Applications/PeterBlum.VAM.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program
Files\Professional Validation And More v0.9.2\Support
Applications\PeterBlum.VAM.DLL
LOG: Entering run-from-source setup phase.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.


--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
 
P

Peter Blum

Hi Adam and Suzanne,

Thanks for both of your responses.

Adam, your idea of using the .Net Configuration Tool was very helpful. I
generated a file that worked and compared it to the file I posted. The
difference was the namespace definition.
I wrote:
<assemblyBinding xmlns:asm="urn:schemas-microsoft-com:asm.v1">
It should have been:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
I'm not sure where I picked up the "asm" part.

--- Peter Blum
www.PeterBlum.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top