Re: using GAC



Tony,

When you look at the GAC in explorer, it actually isn't a folder view.
I ^looks^ like a folder view, because there a shell handler which gives it a
folder-appearance.

The reason why you set your reference to a local copy of the assembly is
so that you can compile your code. The compiler needs to see the assembly,
and it can't pull the one from the GAC.

However, when you set the "Copy Local" property to false, what ends up
happening is that it doesn't place a copy of the referenced assembly in the
bin directory with your compiled app.

When the app runs, Fusion (the name for the mechanism in the CLR by
which assemblies are located) sees that the referenced assembly is not in
the local application directory (since it wasn't copied at build-time), and
then at some point (there are a few other locations it looks) goes to the
GAC (assuming it is strong-named).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Tony Johansson" <johansson.andersson@xxxxxxxxx> wrote in message
news:T1nHg.14213$E02.5333@xxxxxxxxxxxxxxxxxx
Hello!

I have read some info on the WWW about GAC
It says the following.

"If you want to use an assembly from the GAC,
you should drop your assemblies into a local folder,
and then add a reference to the assembly from this folder.
You may want to set the "Copy Local" property to False for
that assembly if you do not want the assembly to be copied
locally to your project folders. At runtime, the application
will automatically use the assembly from the GAC. "

This GAC as I have understood is just a folder view and does not contain
any shared library dll.

At the end of the text it says "At runtime, the application
will automatically use the assembly from the GAC. " but hello the GAC
doesn't
contain any assembly so how can it then use the assembly from the GAC
when GAS just a folder view. This must be wrong.

At runtime it must use the actual shared assembly dll otherwise it
shouldn't work.

//Tony









.



Relevant Pages

  • RE: AppDomain wont recycle on web.config change since 1.1 to 2.0
    ... All assemblies are in the GAC. ... All assemblies are in the GAC, we do not have a /bin folder. ... application restart and even it did, some assembly will not load correctly ...
    (microsoft.public.dotnet.framework.aspnet)
  • 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: Appl. Security Problems
    ... Recompile your three assemblies in release mode. ... If any copies ended up the GAC (for example, ... Attempt to run the EXE from the network folder. ...
    (microsoft.public.dotnet.security)
  • Global Assembly Cache
    ... I took over a legacy e-commerce project that utilized.NET 1.1 to create the website code and all associated assemblies. ... Right now they have a separate directory for each store, complete with a \bin folder that contains about 20 DLL files. ... Can I simply drop these DLL files in the GAC and then delete the corresponding DLL files in the \bin folder for each site? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to Obsolete two related classes?
    ... Remember assemblies in the GAC can be versioned. ... | I want to make /both/ of these classes Obsolete, ... I can compile my assembly and get Warnings if I try to ...
    (microsoft.public.dotnet.languages.vb)

Loading