473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

App.config file <bindingRedirect> problems

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\fusio n.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\confi g\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: PL****@PeterBlum.com
Jul 19 '05 #1
3 20831
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" <PL****@Blum.info>
!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: <ew**************@TK2MSFTNGP11.phx.gbl>
!Newsgroups: microsoft.public.dotnet.general
!NNTP-Posting-Host: h0008021f4212.ne.client2.attbi.com 24.61.166.179
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.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\fusi on.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\conf ig\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: PL****@PeterBlum.com
!
!
!

Jul 19 '05 #2
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/P...8-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" <PL****@Blum.info> wrote in message
news:ew**************@TK2MSFTNGP11.phx.gbl...
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\fusio n.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\confi g\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: PL****@PeterBlum.com

Jul 19 '05 #3
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

"Adam Semel" <as****@online.microsoft.com> wrote in message
news:j$**************@cpmsftngxa06.phx.gbl...
Hey Peter,

Is this an app.config file that you built manually or did you let the
net configuration tool build this file for you? I have had some difficulty
when building this file myself, only to find that letting the .net
configuration tool build it for me not only works, but is much quicker.

Let me know if you still have problems.

Adam Semel
Windows Installer Team
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scanner2001 | last post by:
I have a dll, which is version 1.0.0.23456, with the last part being the auto numbered part. It has been installed in the GAC and there are a couple of .net exe's using it. I now want to update the...
2
by: Tomas Vera | last post by:
Hello All, I have a Commerce Server application that uses Microsoft.VisualBasic.Compatibility.DLL . My development machine uses Framework 1.0.3705 . When I deploy this app to a machine with...
19
by: Richard Grimes | last post by:
I have just installed VS2005 RTM on a machine that has *never* had any of the beta versions. It did have VS2003, but I uninstalled that. I built a DLL with the new managed C++ syntax. The linker...
10
by: pvdg42 | last post by:
Two installations of VS 2005 Pro RTM. Same symptom with both. Simple Win32 Console application compiles fine, but when I attempt to run (with or without debugging), message appears: failed to find...
0
by: Rokas Valantinas | last post by:
Hi, After deploying ASP.NET webservices to clients testing environment, some problems occured with assembly versioning. Exception log showed that CLR ignores <bindingRedirect> tag and it's...
7
by: Peter Blum | last post by:
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...
1
by: Prirolian | last post by:
Here is my config file for foo.exe. I have two versions of FooServer in the GAC, 1.0.0.1 and 1.0.0.2. "foo" was compiled for 1.0.0.2. I want it to use 1.0.0.1 but it still calls 1.0.0.2. Fuslogvw...
10
by: =?Utf-8?B?TUNN?= | last post by:
What does this do? <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />...
0
by: senglory | last post by:
I wrote in web.config the following lines: <system.web> <customErrors mode="Off"/> </system.web>
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.