Assembly version compatibility issue

B

Bob

I have a common assembly DLL that's installed into GAC (using msi created by
a setup project). It contains classes used by all the applications we have.
This works well but when I increase the version number (say, from 1.0.0 to
1.01), all existing applications have to be recompiled even if the change to
the assembly is to add new classes (that is, no change to existing classes).
I'd think there should be a way to make this version compatible. I have to
increase the version # for the msi to automatically uninstall the older DLL
and install the newer DLL properly when it's deployed.

Could anyone give me any suggestions? My goal is to keep the existing
client application intact (no recompilation) when new features are added to
the common assembly (that is, no change to any existing public interfaces in
the assembly).

Thanks
Bob
 
D

David Browne

Bob said:
I have a common assembly DLL that's installed into GAC (using msi created by
a setup project). It contains classes used by all the applications we have.
This works well but when I increase the version number (say, from 1.0.0 to
1.01), all existing applications have to be recompiled even if the change to
the assembly is to add new classes (that is, no change to existing classes).
I'd think there should be a way to make this version compatible. I have to
increase the version # for the msi to automatically uninstall the older DLL
and install the newer DLL properly when it's deployed.

Could anyone give me any suggestions? My goal is to keep the existing
client application intact (no recompilation) when new features are added to
the common assembly (that is, no change to any existing public interfaces in
the assembly).


You need to deploy the new assembly with a publisher policy.

"Vendors of assemblies can state that applications should use a newer
version of an assembly by including a publisher policy file with the
upgraded assembly. The publisher policy file, which is located in the global
assembly cache, contains assembly redirection settings."
-from
http://msdn.microsoft.com/library/d...uide/html/cpconAssemblyVersionRedirection.asp

David
 
B

Bob

Thanks a lot. This is what I needed. I think using the policy file is the
best choice for my situation.

After reading a little more about this, looks like the policy file (xml
file) needs to be compiled into an assembly (policy.*.dll) and this can only
be done using al.exe. Can VS.NET do this? I can't seem to find something
like a policy project in VS.NET. I have my common assembly project and its
setup project in one solution and want to keep everything related in one
place if possible.

It's odd that after the policy file is compiled into an assembly, the file
itself is still needed and must be deployed together with the policy
assembly. Maybe this is something Microsoft didn't quite finish.

Thanks again.
Bob
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top