473,471 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to prevent a project from referencing an assembly in the GAC

Hi there

I have a class library project (AssemblyA) and a 'test' project grouped
under the same solution. AssemblyA is strongly-named and I have a
version of the assembly in the GAC.

In the test project I have added a project reference to AssemblyA. If I
make changes to AssemblyA (e.g. add a new class) and then try to run
the project in debug mode, Visual Studio loads the AssemblyA from the
GAC and hence cannot find the new type. How do I force Visual Studio to
use the 'local' copy of the assembly, not the one in the GAC?

Any help would be much appreciated.
Matt

Oct 11 '05 #1
4 3128
Look at the reference and where it is set to. You should be able to point at
the newly compiled assembly and solve the problem.

For the record, you should only use the GAC for global assemblies and
preferably only when they are stable and mature. If you are constantly
changing an assembly, it is not ready for the GAC.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"mj***@hotmail.com" wrote:
Hi there

I have a class library project (AssemblyA) and a 'test' project grouped
under the same solution. AssemblyA is strongly-named and I have a
version of the assembly in the GAC.

In the test project I have added a project reference to AssemblyA. If I
make changes to AssemblyA (e.g. add a new class) and then try to run
the project in debug mode, Visual Studio loads the AssemblyA from the
GAC and hence cannot find the new type. How do I force Visual Studio to
use the 'local' copy of the assembly, not the one in the GAC?

Any help would be much appreciated.
Matt

Oct 11 '05 #2
Thanks for your response, Gregory.

If I right-click on the reference to AssemblyA in the test project, the
path points to \obj\debug\AssemblyA.dll. However, the version in the
GAC is still loaded.

We use a terminal server here, for developing and for live
applications, so the GAC contains stable releases. I need to be able to
make changes to the AssemblyA code and test them from the test project
within the IDE, but I can't do this at the moment.

Oct 11 '05 #3
when you set a project reference and then click on the reference, what
is the setting of the copylocal property? It may be that the new
assembly is not in the bin folder of the app so .Net looks in the GAC
and finds it there.

Oct 11 '05 #4
The CopyLocal setting was set to true, but it makes no difference if I
set it to false - it always loads from the GAC.

Oct 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jody Gelowitz | last post by:
Is this possible? I have compiled an assembly in VS2005 and am trying to add a reference to that assembly from my VS2003 project. The error that I am getting is: A reference to '{path to vs2005...
6
by: Manuel Lopez | last post by:
Hello, I have a Web Project (UserControls.dll) with some user controls that is shared by many asp.net web applicattions. What we do is copy UserControls.dll to all the applications bin...
11
by: Just Me | last post by:
I have a solution containing many usercontrol projects. When I wish to reference a usercontrol in another project I can select either the project or the assembly. Does it make a difference which...
4
by: Christopher C. Bernholt | last post by:
We have a solution which contains 2 projects. The first project is a windows control and it references an assembly. The second project is a test windows application used to test the windows...
4
by: mje11 | last post by:
Hi there I have a class library project (AssemblyA) and a 'test' project grouped under the same solution. AssemblyA is strongly-named and I have a version of the assembly in the GAC. In the...
4
by: Jon | last post by:
I'm wondering what people recommend. I used to have all my programs reference another project that held general functions and classes I knew I would want to reuse. Lately, I've switched to just...
4
by: TS | last post by:
in my web project's bin folder, the dll, that comes from a project reference of a class library in same solution, can't be deleted. it says it has a sharing violation. i also cannot delete the...
1
by: Joe | last post by:
I removed and re-added several controls in the toolbox. I also removed the references from the project and re-added them but when the project runs it complains it can't find the older version. ...
24
by: =?Utf-8?B?RHIuIFMu?= | last post by:
I am incorporating three existing programs into a new "all in one" program. I have added the three projects to the new all in one project. How do I instruct the new initial menu to launch the main...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.