Proper use of the GAC and referencing old versions of a DLL

S

Scott Vercuski

Everyone,

I have a question about the proper use of the GAC and how to
reference past versions of a DLL. Let me lay out the scenario ...

Suppose we have a DLL named GACTest.dll ...

Version 1 has a function Add(int a, int b) ... just adds the two
numbers and returns the result. I've registered that in the GAC and
gave it the version number 1.0.0.0. I installed the DLL in
C:\WINNT\Microsoft.NET\Framework\v1.1.4322

I created a test page and called the Add function with 2 intgers
and everything works fine.

Now I go back in and change the Add function to ... Add(int a, int
b, int c). I change the version number to 1.1.0.0, recompile and put
it in the same directory (C:\WINNT\Microsoft.NET\Framework\v1.1.4322)
and re-register it in the GAC. When I look in the GAC I see two
versions of the DLL as I expected to ... one is version 1.0.0.0 and
the other is 1.1.0.0 and in my code when I call the Add function and
supply 3 parameters ... it works fine ... but how would I reference
the OLD version? if I only wanted to call the Add function with two
parameters? How do I reference 1.0.0.0?

Thank you in advance for any help
If you would like to contact me please do so at
(e-mail address removed)

Thank you,
Scott Vercuski
(e-mail address removed)
 
M

Mattias Sjögren

Scott,
I installed the DLL in C:\WINNT\Microsoft.NET\Framework\v1.1.4322

Why? That directory is primarily for framework assemblies.

but how would I reference
the OLD version? if I only wanted to call the Add function with two
parameters? How do I reference 1.0.0.0?

Keep a copy of it in some directory, and don't overwrite it with
v1.1.0.0. Browse to it from VS.NET's Add Reference dialog.



Mattias
 

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