|
-
Apr 20th, 2005, 02:49 AM
#1
Thread Starter
Lively Member
Shared Assembly
Hi,
i am working on shared assembly and GAC. i have created a shared assembly and given it a strong name, and registered it in the gac. but i was not able to find this shared assembly in the add reference dialog box, so after searching for a long time i got to know that we can create a key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders and specify the folder path (e.g c:\temp\myassembly) where i want to keep my assemblies. So after that i am able to see this assembly in add refernce dialog box.
but problem with me is that,
1. when will my assembly in gac will be called. i am not able to access the assembly from gac. it always call the assembly from the folder specified in registry.
2. Even if i don't create a shared assembly and put it in the folder which i have set in the registry i am able to access the assembly as a shared assembly. so why to create a shared assembly and put it in gac.
-
Apr 21st, 2005, 04:20 AM
#2
Hyperactive Member
Re: Shared Assembly
 Originally Posted by sachien
1. when will my assembly in gac will be called. i am not able to access the assembly from gac. it always call the assembly from the folder specified in registry.
You need to differentiate between design time and runtime.
In runtime if you have an assembly placed in your GAC, your Application will always use the assembly in your GAC.
 Originally Posted by sachien
2. Even if i don't create a shared assembly and put it in the folder which i have set in the registry i am able to access the assembly as a shared assembly. so why to create a shared assembly and put it in gac.
This is why you should use the GAC:
- Data Security
Since the GAC is usualy installed in you WINNT Folder, only Admins are allowed to install or delete assemblys.
- Side by Side Execution
It is possible to have more than one version of your assembly in your GAC at the same time. (e.g Version 1.0 and 1.1)
- Integrity check
For each assemblys in your GAC the Integrity will be checked
- Performance Advantages
1. No more varification (Important if you use the assembly a lot)
2. Only one Instance of the Assembly (speeds up loading if more than one Client access your assembly)
3. Quick find of the Assembly through the Common Language
I am no expert on the GAC but I think thats the way to go with .NET. So you should always use the GAC for your .NET Assemblys.
HTH,
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
May 9th, 2005, 06:45 AM
#3
Addicted Member
Re: Shared Assembly
A few thoughts,
As we all know now, one of the failings of COM was dll hell. .NET allows us to install local instances of dll's to each application. Any changes to other apps dll's has no effect on yours.
IF you put them into the GAC you have to beware of recreating dll hell if you don't revision everytime.
Its probably unwise to allow user's priviledge to install apps under normal conditions and disc space is bountiful.
If you need to ensure that the myriad applications which use your dll use the latest with minimum effort from you then he GAC is a good place to consider.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|