Re: Using Custom Assembly Installed in GAC

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Chris Fink (ChrisFink_at_discussions.microsoft.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 10:24:03 -0800

Hi Scott,

If I take your approach of placing the shared assembly in the applications
bin folder should I set the copy local=false? I assume that if this is set
to true, the assembly in the bin folder will be executed regardless of
whether or not it is in the GAC.

Second, how does the application determine whether to use the local assembly
or one from the GAC? I assume the GAC always has priority, ifso, how do you
allow the app to use the one in bin over the GAC, if assemblies exist in both
locations.

Thanks for your help!
"Ken Cox [Microsoft MVP]" wrote:

> Hi Chris,
>
> Hi Chris,
>
> You can add a copy of the DLL to another location on your system and
> reference it from there to keep you code happy and give you Intellisense
> support. I often put it in the /bin folder. If there's a version in the GAC,
> the executable will use the GAC copy at runtime.
>
> Regarding the use of gacutil, I would suspect Microsoft is trying to tell
> you to use Windows Installer technology to put production components in the
> GAC.
>
> Ken
> Microsoft MVP [ASP.NET]
>
> "Chris Fink" <ChrisFink@discussions.microsoft.com> wrote in message
> news:926C8963-7794-42CF-933F-969C294E89FA@microsoft.com...
> > Using the GacUtil I created a SNK and deployed my assembly to the GAC
> > using
> > the GACUTIL. When browsing to c:\[SystemRoot]\Assembly I can see my
> > custom
> > assembly. However, how do I use it in a new project? I don't see it
> > listed
> > as a component in the .NET Add reference section?
> >
> > Also, why does MS say that the GacUtil is for development only? What do
> > they
> > recommend using when moving production components to the gac?
>
>



Relevant Pages

  • Re: .NET versioning
    ... >> If this isn't dll hell then it's awfully close. ... > xcopy deployment, which thus means avoid the GAC if possible. ... > 2) if required, and if you really have to, copy the files to the GAC. ... If you overwrite assemblies in the GAC ...
    (microsoft.public.dotnet.framework)
  • Re: Referencing shared assembly in your project
    ... I am developing add-ons to an already existing ASP.NET application. ... assemblies for those pages in its own bin folder. ... GAC after all. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: GAC hell
    ... The only way to get at the GAC is by calling into the unmanaged fusion API's. ... Beware that the GAC uses fully qualified assembly names to store assembly references, because you don't know whether an assembly resides in the GAC, you also don't have a FQAN, this may result in false positives! ... But we've gotten so far off topic here, we're nowhere near my original question anymore, which had to do with determining which referenced assemblies are in the GAC and which are not. ... So, please if you have a small but complete sample that uses the Microsoft.Vsa namespace to generate/compile/Run "VBScript" and "JScript" scripting code, feel free to post it here. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Please explain why the GAC cannot be referenced
    ... Gac assemblies show up under the reference tab. ... Look through you referenced assemblies for the name of the assembly, ... Gac'd assemblies provide that function for you and the search order for assemblies starts at the gac to reduce performance issues. ... > old assembly from the GAC and install the newer version. ...
    (microsoft.public.dotnet.framework)
  • Using GACUTIL for patches to report failures and not successes
    ... We currently use gacutil as part of our patch process to remove all current ... versions in the GAC). ... However we have nearly 100 assemblies and a lot of output is generated from ...
    (microsoft.public.dotnet.framework.clr)