Versioning problem

G

Guest

Hi
I am building a .NET Windows application using C#. In my application I am referring to shared library which updates very often(only revision change). Now I want my executable to load latest version of the shared library available in GAC
In short, If I have a shared assembly with version 1.0.0.1 and 1.0.0.2 in GAC and my application was built referring to version 1.0.0.1 ,it should automatically refer to the new version available in GAC i.e. 1.0.0.2 without rebuilding the application
Is this possible in .NET? I referred to an article in codeproject.com which says this can be done but I could not do
The following is the description default verisioning found in the article

Understanding the Default Version Polic

As mentioned earlier in the chapter, if a client is referencing a shared assembly, the major and minor versions must be identical if the bind is to succeed. However, the .NET runtime binds to a given assembly if the assembly reference differs by the revision or build numbers. This behavior is termed the default version policy and is used to ensure that a client always gets the latest and greatest service release (i.e., bug fix) of a given assembly. Thus, if the client's manifest explicitly requests version 1.0.0.0, but the GAC has a newer version by specifying a QFE (such as 1.0.2.2), the client automatically receives the most recent fix. In this way, a client application is guaranteed that the assembly that it is referencing is backward compatible, in addition to being as bug-free as possibl

The link of the article is as follows
http://codeproject.com/books/1893115593_6.as

Can anybody help me out

Thanks in Advance.

Sampat.
 
I

ice88

Sampat Dixit said:
Hi,
I am building a .NET Windows application using C#. In my application I am
referring to shared library which updates very often(only revision change).
Now I want my executable to load latest version of the shared library
available in GAC.
In short, If I have a shared assembly with version 1.0.0.1 and 1.0.0.2 in
GAC and my application was built referring to version 1.0.0.1 ,it should
automatically refer to the new version available in GAC i.e. 1.0.0.2 without
rebuilding the application.
Is this possible in .NET? I referred to an article in codeproject.com
which says this can be done but I could not do.
...
Can anybody help me out.

Thanks in Advance..

Sampat.


Sampat,

I don't know the answer to your problem for sure - but it sounds to me
like the problem is, because the application was linked with 1.0.0.1
and 1.0.0.1 is still available (in the GAC) it will use it - if you
remove 1.0.0.1 and leave 1.0.0.2 in the GAC do you see the expected
behaviour? I'm interested in your results because I may well have a
similar problem soon!

It's interesting to hear that the Major/Minor versions are all that
*NEED* to match - this actually makes things better for me, and goes
part way to explaining why Microsoft view this as a way out of 'DLL
hell', so long as you can ensure that only *ONE* version (the latest)
is in the GAC.

Speaking of which, anyone know how to update the GAC outside of an
MSI install? GacInstall and GacRemove look tempting - but I have
heard that they're not quite all they seem... anyone?
 

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

Top