473,804 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ 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 3176
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\Asse mblyA.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
5158
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 dll}' could not be added. This is not a valid assembly or COM component. ONly assemblies with extension 'dll' and COM components can be referenced. Please make sure that hte file is accessible, and that it is a valid assembly or COM component. ...
6
1656
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 folders an this works correctly. We want to have this shared code in the GAC.
11
1927
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 one I select? Thanks
4
2893
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 control from the first project. As such, it references the windows control using a project reference. In addition, it also references the same assembly that the first project references. The assembly which is referenced by both projects contains...
4
412
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 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...
4
3127
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 referencing the dll that comes from that project. However, when I do this, I often get the message "No source code found at the current location" when debugging...it doesn't always happen, but sometimes. So, I've been thinking of moving back to...
4
1688
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 .projdata file in the class library's obj directory. This is causing updates to the class library not getting seen in the web app. i ran filemon and it just says sharing violation but i dont' know why. i'm sure by closing & re-opening VS.net it...
1
1411
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. I've double checked the version number of the current reference and it says it's the newer one but running the app still looks for the older one. For example if the newer assembly is version 1.1.1 and the older one was 1.0.0, I get a message that...
24
2797
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 menu in each one? I have tried using the DIM statement with .ShowDialog, however, the forms are not recognized as they are listed in seperate projects. Please advise. Thanks, Dr. S.
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10569
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
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 we have to send another system

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.