Re: Trying to get reference from the GAC
- From: "Phil Wilson" <phil.wilson@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Aug 2007 12:04:27 -0700
The GAC is a deloyment choice and typically the first place that the runtime
will search for assemblies when the app runs. It is not really intended to
be a place that you reference assemblies in the development environment.
You can put assemblies anywhere in the file system and browse to them if you
want to add a reference. This "references in the GAC" is a common question,
and my guess is that people believe that if an assembly is going to be
deployed to the GAC then they must reference it at development time in the
GAC, but that's not the case. ( Visual Studio's references at development
time are not to the GAC. )
--
Phil Wilson
[MVP Windows Installer]
"David Thielen" <thielen@xxxxxxxxxxxxx> wrote in message
news:75FABC7C-C77B-4252-929B-6EB0699B4C31@xxxxxxxxxxxxxxxx
I had assumed there was a way to say "look in the GAC" without giving it
the
specific file location. Based on your post below I assume that works for a
running program but not for Visual Studio?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
"Steven Cheng[MSFT]" wrote:
Hi Dave,
From your description, you want to change the .NET framework system
assemblies' reference path (in Visual Studio IDE at development time)
from
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" to their GAC location,
correct?
Based on my understanding, the system assemblies seems be particularly
processed in the Visual Studio's design-time and will always point to the
framework folder. Also, I don't think it is safe to redirect the
reference
path to the GAC path since GAC path is in a customized folder "%system
dir%\assemblies" which is not intended to be used by user directly(other
than the .net clr runtime itself).
If you do want to share the same location of those framework assemblies,
I
think you can consider the following means(though it is not documented
and
not guranteed to work well):
** For Visual STudio 2005, you can manually add a registry entry to make
a
custom folder become one of the search paths when you launch "Add
Reference" dialog in Visual Studio IDE
#Adding assemblies to the Add References dialog in Visual Studio 2005
http://blogs.msdn.com/astebner/archive/2005/11/28/497693.aspx
** You can move those assemblies you want to share the same physical path
to a custom folder and add that custom folder as one of the search path
(as
above)
** In your project, you can try removing those existing reference to .net
framework assemblies and add new reference against the new place to see
whether it works.
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
.
- Follow-Ups:
- Re: Trying to get reference from the GAC
- From: Steven Cheng[MSFT]
- Re: Trying to get reference from the GAC
- References:
- RE: Trying to get reference from the GAC
- From: Steven Cheng[MSFT]
- RE: Trying to get reference from the GAC
- From: David Thielen
- RE: Trying to get reference from the GAC
- Prev by Date: Why Visual Studio 2005 don't set a default namespace?
- Next by Date: Re: How could I store values from checked checkboxlist onto database?
- Previous by thread: RE: Trying to get reference from the GAC
- Next by thread: Re: Trying to get reference from the GAC
- Index(es):
Relevant Pages
|