Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / May 2004

Tip: Looking for answers? Try searching our database.

shared Assemblies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Baren - 20 May 2004 10:36 GMT
I Created 2 versions of an assemblies in GAC..Now I have 2 projects one of which will refer to Version 1 of the Assembly and Other to Version 2 of the Project. Now My question is where should i give the assembly version numbers in my project
Remember..i created 2 assemblies first and then the 2 projects

Thanks
Baren
Patrik L?wendahl - 20 May 2004 11:11 GMT
Hi Baren,

You set the version number in the AssemblyInfo.cs (or AssemblyInfo.vb) file,
there's an attribute defined in that file called AssemblyVersion.

--
Patrik L?wendahl
www.cshrp.net - 'Elegant code by witty programmers'

> I Created 2 versions of an assemblies in GAC..Now I have 2 projects one of which will refer to Version 1 of the Assembly and Other to Version 2 of the
Project. Now My question is where should i give the assembly version numbers
in my project.
> Remember..i created 2 assemblies first and then the 2 projects.
>
> Thanks,
> Baren
Baren - 20 May 2004 12:21 GMT
Hi! Patrik

well i think u didn't get the question correctly.. i hv already created 2 version of assembly..now how do refer to a particular version in my applicatio

Thanks
Baren
Patrik L?wendahl - 20 May 2004 12:39 GMT
Baren,

I see, sorry for that.

There's a couple of ways to do that.

First of all you could add a reference to the version of the dll you project
needs. Build the dll's and put them in separate folders i.e.
MyDll\1.0.0.0\MyDll.Dll  and MyDll\2.0.0.0\MyDll.Dll and then in yout
applications references point out the dll you want for your application.

Second, if the application already is built, you can use an application
config file to change the assembly bindings and tell the application how to
load assemblies.

Third you could add your v1 dll project to your v1 application solution and
in the v1 app project set a reference to the v1 dll project.

Option 1 and 3 will effectivly write information about your dll into the
applications assembly manifest. The information is Name, Version, [optional]
PublicKey and [optional] Culture. When the application is loading, it need
to find a dll where all these criterias are met. If it can't, the version
number is wrong for example, the application will fail to load with an
FileNotFoundException.

Does this clear things for you?

--
Patrik L?wendahl
www.cshrp.net - 'Elegant code by witty programmers'

> Hi! Patrik ,
>
> well i think u didn't get the question correctly.. i hv already created 2 version of assembly..now how do refer to a particular version in my
application

> Thanks,
> Baren
Baren - 20 May 2004 13:01 GMT
Thanks Patrik

Well the 2nd solution is good one.. Actually i tried to impliment the same in my Application.cofig file to point to different version of  assembly. but every time it gets me the latest version's methods. Can you help me in that.. 'czo it is waste to maintain 2 physical version of dll

what should i specify for "oldVersion" and "newVersion" for the 1st version of the assembly in Application config file

Thanks
Baren
Patrik L?wendahl - 20 May 2004 13:17 GMT
Baren,

If you have two versions of the dll, you need two physical versions of it
too.

For the App.Config variant you still need to have a reference to the
original dll. So for your V1 dll you won't need any assembly binding config
if the application is built referencing the first version dll.

But if it's built with the first version and you want it to load the second
you set oldVersion to 1.0.0.0 and newVersion to 2.0.0.0

--
Patrik L?wendahl
www.cshrp.net - 'Elegant code by witty programmers'

> Thanks Patrik,
>
> Well the 2nd solution is good one.. Actually i tried to impliment the same in my Application.cofig file to point to different version of  assembly. but
every time it gets me the latest version's methods. Can you help me in
that.. 'czo it is waste to maintain 2 physical version of dll.

> what should i specify for "oldVersion" and "newVersion" for the 1st version of the assembly in Application config file.
>
> Thanks,
> Baren
Baren - 21 May 2004 08:06 GMT
Hi! Patrik

Well we maintain 2 physical versions of the dll then its the same old story of maintining the dll.. then wats the need of .NET
i think there might be someway where we can have one physical dll file and it will just refer to the different versions of the assemblies registered in GAC

Regards
Baren

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.