473,465 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Create 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 2169
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.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="StrongLibrary"
publicKeyToken="6b5322bd2869c315"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="1.0.0.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Then make a Publisher Policy Assembly. This is done using the assembly
linker tool.
al /link:publisherPolicyFile /out:publisherPolicyAssemblyFile
/keyfile:keyPairFile
In this command:
The publisherPolicyFile argument is the name of the publisher policy file.
The publisherPolicyAssemblyFile argument is the name of the publisher
policy assembly that results from this command. The assembly file name
must follow the format: policy.majorNumber.minorNumber.mainAssemblyName.dl l
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.config /out:policy.1.0.StrongLibrary.dll
/keyfile:StrongLibrary.snk

You then use the gacutil to register the policy.
gacutil /I policy.1.0.StrongLibrary.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
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...
0
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...
3
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...
2
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...
1
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-...
5
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...
1
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...
6
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...
6
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
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...

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.