473,624 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GAC assembly versioning policy QFE behavior

I am trying to get QFE (Quick Fix Engineering) working with an assembly
installed in the GAC. I have two books that claim if two different version
of the assembly are installed in the GAC -AND- they vary only by revision
number, then the default policy is to load the higher number version. I am
not able to reproduce this behavior in practice.

My test case is simple. I wrote a class with AssemblyVersion 1.0.0.1.
Installed into GAC. Created a console application that reference this
assembly to verify it works. I then created a second assembly (with the same
assembly name) and made it version 1.0.0.2. I installed this into the GAC.
I verified that both version exist by using the GUI viewer for the GAC. I
then reran my console application without recompiling. It is still using the
1.0.0.1 version (the class I built returns the version number so I know this
for certain).

So my question is why won't won't the CLR recognize that a newer version is
available and automatically start using it?

Thank You

James Tyner
..NET Developer
Mar 24 '06 #1
2 2175
I have two books that claim if two different version
of the assembly are installed in the GAC -AND- they vary only by revision
number, then the default policy is to load the higher number version. I am
not able to reproduce this behavior in practice.


Your books are wrong, and the behaviour you've observed is the way
it's designed to work. Unless you tell it otherwise, the CLR will only
bind to the exact version that was referenced.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mar 24 '06 #2
Following is a small part of an email i sent to some of our developers
to handle this same issue. Hopefully it gives you enough information to
at lease figure out where to look.
----------------------------
There is a way to create and register an item called a Publisher Policy
Assembly. You can then redirect all users of a dll to a new version.
Following are the steps.

First create the configuration file. This has the same information that
I previously put in the application configuration file.
<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
<dependentAssem bly>
<assemblyIdenti ty name="StrongLib rary"
publicKeyToken= "6b5322bd2869c3 15"
culture="neutra l" />
<bindingRedirec t oldVersion="1.0 .0.0"
newVersion="1.0 .0.1"/>
</dependentAssemb ly>
</assemblyBinding >
</runtime>
</configuration>

Then make a Publisher Policy Assembly. This is done using the assembly
linker tool.
al /link:publisherP olicyFile /out:publisherPo licyAssemblyFil e
/keyfile:keyPair File
In this command:
The publisherPolicy File argument is the name of the publisher policy file.
The publisherPolicy AssemblyFile argument is the name of the publisher
policy assembly that results from this command. The assembly file name
must follow the format: policy.majorNum ber.minorNumber .mainAssemblyNa me.dll
The keyPairFile argument is the name of the file containing the key
pair. You must sign the assembly and publisher policy assembly with the
same key pair.

The following is the command I used in my prototype.
al /link:policy.con fig /out:policy.1.0. StrongLibrary.d ll
/keyfile:StrongL ibrary.snk

You then use the gacutil to register the policy.
gacutil /I policy.1.0.Stro ngLibrary.dll
---------------------------------------------------
Hope that helps
Leon Lambert

jtyner wrote:
I am trying to get QFE (Quick Fix Engineering) working with an assembly
installed in the GAC. I have two books that claim if two different version
of the assembly are installed in the GAC -AND- they vary only by revision
number, then the default policy is to load the higher number version. I am
not able to reproduce this behavior in practice.

My test case is simple. I wrote a class with AssemblyVersion 1.0.0.1.
Installed into GAC. Created a console application that reference this
assembly to verify it works. I then created a second assembly (with the same
assembly name) and made it version 1.0.0.2. I installed this into the GAC.
I verified that both version exist by using the GUI viewer for the GAC. I
then reran my console application without recompiling. It is still using the
1.0.0.1 version (the class I built returns the version number so I know this
for certain).

So my question is why won't won't the CLR recognize that a newer version is
available and automatically start using it?

Thank You

James Tyner
.NET Developer

Mar 27 '06 #3

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

Similar topics

10
504
by: Simon Wallis | last post by:
I know the general purpose for the GAC is to share a component among many applications. But even when you add something to the GAC, you still have to manually create a reference to the DLL in your project (right?). So what have I gained by adding it to the GAC?
0
407
by: Doug | last post by:
I have component A that references component B and component B uses versioning and publisher policy files. Component A also references component C and component C also references component B. A was compiled against version 1.0.0.1 for component B and C was referenced against version 1.0.0.0 for component B. Now when A calls functionality within component C that in turn calls component B I get an error ("component B or one of it's...
3
1502
by: Dathon | last post by:
I have an application that is comprised of multiple dll's and exe's, all with strong names. Let's say that all of these applications use a utility library Utility.dll, and let's say the version of Utility.dll is 1.0.0.0. I then make a small change to the Utility library, which I want to push out to uses in the form of a patch. Since it's a minor change, I increment the version of the Utility assembly to 1.0.0.1. What I'd like to do...
2
1623
by: Ily | last post by:
Hi I have several versions of an assembly in the GAC My problem is that I want my clients (windows + web clients) to use a specific version of an assembly I can get this to work by using the <assemblyBinding> tag in the app.config
1
1188
by: jtyner | last post by:
I am trying to get QFE (Quick Fix Engineering) working with an assembly installed in the GAC. I have two books that claim if two different versions of the assembly are installed in the GAC -AND- they vary only by revision number, then the default policy is to load the higher number version. I am not able to reproduce this behavior in practice. My test case is simple. I wrote a class with AssemblyVersion 1.0.0.1. Installed into GAC. ...
5
2625
by: Igor | last post by:
Hi! We built VB6 application to work with Reporting Services server. To connect to reporting server has been created a special assembly with .NET VS2003. While we execute our program on local machine, every thing works. But when we put the whole program on network drive, the VB6 program could not create required object from .NET assembly. Nothing we done were not useful to help to solve the problem. Does anybody have idea?
1
2246
by: Coaster | last post by:
orig ref here http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ff29cc370678911d/c0db5b7e3da283b9?lnk=st&q=gac+assembly+new+version&rnum=7#c0db5b7e3da283b9 I have pasted the part I'm interested in below. My company doesn't use versioning or the gac and I'd like to. We're on vs.net 2005 & .net 2., is this still true or has it changed since then? thanks That article is not entirely accurate. ...
6
3542
by: Ben | last post by:
Hi all, First i have to state this is my first entry ever in a forum. So please be forgiving... I am a newbe to dotnet versioning... The Situation is the following: Our application is using an external managed .dll. Whos version is changing from time to time. The interface is not changing at all. As i have included this dll in my
6
15266
by: Andrus | last post by:
VCSE 2005 .NET 2 WinForms I created assembly at runtime and added mydll.dll reference to it. mydll.dll is in applicatino startup directory. When I change mydl.dll to never version, this assembly is not loaded anymore: error occurs which says that created assembly requires specific version of mydll.dll How to add assembly reference at runtime which does not require specific version ?
0
8231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8672
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.