Re: using GAC
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 24 Aug 2006 15:49:02 -0400
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
.
- Follow-Ups:
- Re: using GAC
- From: Tony Johansson
- Re: using GAC
- References:
- using GAC
- From: Tony Johansson
- using GAC
- Prev by Date: NTLM Authentication
- Next by Date: Re: VS2005 reference issue/change/bug
- Previous by thread: using GAC
- Next by thread: Re: using GAC
- Index(es):
Relevant Pages
|
Loading