GAC

Raghunandan44
Raghunandan44 used Ask the Experts™
on
HI ,

I am developing a Common Class Library that i wish to install it into the gac . I have Hard Coded the Assembly version of the Dll's to 1.0.3 so that if i make changes to the library and compile also it does not change .

Question 1 : Am I Going on the Right Track I mean should i hard Code the Assembly version.

2) Do i have to install and un-install the dll everytime i build the class library or because i have hard coded the assembly version it will automatically pick up the new version.

3) If i include the dll in a web project do i have to remove and add the refrenece everytime i make changes to the common library

4) Is this the right way to do

5) any other good way to do please do suggest

Thanks

Raghu
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
In Question 2) Do i have to install and un-install the dll everytime i build the class library or because i have hard coded the assembly version it will automatically pick up the new version.
 I meant in the GAC

Thnaks
Raghu
this is what i do everytime i want to compile my dll and add to gac:

csc /t:library /out:FutureShirts.dll AssemblyInfo.cs Global.cs Futura.cs
gacutil /u FutureShirts
gacutil /i FutureShirts.dll

note: do not hard code the assembly version.  It won't work.  

you'll have to do this:

[assembly: AssemblyVersion("1.0.*")]

and you'll have to update the version in your web.config every time you reinstall it to GAC.

read this for more info: http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21038573.html


HTH - Trevor
btw, i put those csc and gacutil commands in a batch and just execute it
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Author

Commented:
hi ,

Thanks for the Quick Reply . If i have the assembly version as you suggested won't that change every time i compile and will that make me add and remove the refrence in the web project . Sorry I'm a newbie  

Thanks

Raghu
If you are directly accessing the assembly from GAC then you need not to change the refrence as

gacutil /u FutureShirts
gacutil /i FutureShirts.dll

Will first uninstall the dll and then add a new version but if you are refrencing the dll from local folder then simply replace the dll.

Author

Commented:
Thanks a Lot For the Quick Replies .

Raghu

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial