[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Techno_Dex

8/28/2008 1:37:00 PM

What are the advantages of GACing then NGENing an assembly as opposed to
just NGENing an assembly? My understanding is the GAC is to be used as a
versioning respository for common assemblies used by multiple applications
and NGENing is to create a native compiled copy of the assembly so it is
optimized to run faster on the given machine. Since NGEN is just a special
section within the GAC, is there really a need to GAC then NGEN or is NGEN
good enough? Is this dependent or independent of the assembly being a
common among multiple applications?


2 Answers

Alvin Bruney [ASP.NET MVP]

8/28/2008 5:05:00 PM

0

The two aren't really related. GAC'ing refers to placing a static copy of
the image in a particular place. NGEN is really about placing a compiled
image of the assembly and its dependencies into the native cache for use at
run-time. For that reason, you can ngen and gac'd assembly although there
are some corner cases to be aware of. See this link for the scoop
http://msdn.microsoft.com/en-us/librar...(VS.80).aspx

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/De...
-------------------------------------------------------


"Techno_Dex" <Techno_Dex@hotmail.com> wrote in message
news:#Wg7kMRCJHA.5656@TK2MSFTNGP04.phx.gbl...
> What are the advantages of GACing then NGENing an assembly as opposed to
> just NGENing an assembly? My understanding is the GAC is to be used as a
> versioning respository for common assemblies used by multiple applications
> and NGENing is to create a native compiled copy of the assembly so it is
> optimized to run faster on the given machine. Since NGEN is just a
> special section within the GAC, is there really a need to GAC then NGEN or
> is NGEN good enough? Is this dependent or independent of the assembly
> being a common among multiple applications?
>

Techno_Dex

8/28/2008 9:18:00 PM

0

This is partly why I'm a little confused about this subject, the native
image cache is just a special section within the Global Assembly Cache. You
can GAC an Assembly, NGEN an assembly or GAC an Assembly then NGEN that same
assembly if you use the "Display Name" which you retrieve from the GAC when
NGENing the assembly. When you say GACing is placing a static copy of the
image in an particular place, my understanding is this is for sharing
purposes so more than one application can can access the same assembly with
a specific version in order to avoid DLL Hell in the event someone installs
a new copy of the same assembly over the top of the original one on disk.
By GACing, there is a custom calculated name created in the GAC to store
each versioned copy. The only thing I can come up with is if you NGEN an
assembly there is an optimized copy put into the Native Image Cache (AKA
special section of the GAC) where no other applications and or vendors can
access your assembly??? But then I read that NGEN'd files can be accessed
across application domains which tosses that notion out the window. What am
I missing?


"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filter> wrote in
message news:1AD16D0B-3A82-4B67-AE68-E3100538A892@microsoft.com...
> The two aren't really related. GAC'ing refers to placing a static copy of
> the image in a particular place. NGEN is really about placing a compiled
> image of the assembly and its dependencies into the native cache for use
> at run-time. For that reason, you can ngen and gac'd assembly although
> there are some corner cases to be aware of. See this link for the scoop
> http://msdn.microsoft.com/en-us/librar...(VS.80).aspx
>
> --
>
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> Download OWC Black Book, 2nd Edition
> Exclusively on www.lulu.com/owc $15.00
> Need a free copy of VSTS 2008 w/ MSDN Premium?
> http://msmvps.com/blogs/alvin/De...
> -------------------------------------------------------
>
>
> "Techno_Dex" <Techno_Dex@hotmail.com> wrote in message
> news:#Wg7kMRCJHA.5656@TK2MSFTNGP04.phx.gbl...
>> What are the advantages of GACing then NGENing an assembly as opposed to
>> just NGENing an assembly? My understanding is the GAC is to be used as a
>> versioning respository for common assemblies used by multiple
>> applications and NGENing is to create a native compiled copy of the
>> assembly so it is optimized to run faster on the given machine. Since
>> NGEN is just a special section within the GAC, is there really a need to
>> GAC then NGEN or is NGEN good enough? Is this dependent or independent
>> of the assembly being a common among multiple applications?
>>