473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems debugging multiple projects in IDE when projects are GAC DLLs

I can hardly believe I'm the first one to report this, but having gone
through the newsgroup, it appears that way.

I would like to open a solution in the VS.NET IDE that consists of
multiple DLLs and a test application (an .EXE). The .EXE is my startup
application. All the DLLs are shared components. This means that they
contain a key and are stored in the GAC.

When I go to run the test application in the IDE, it will not execute
because it complains that it cannot find the DLL or one of its
dependencies. Here are several pieces of information you need to be
aware of before going any further...

* I use version 1.1 of the .NET Framework (and VS.NET 2003)

* Many of the DLLs reference the other DLLs in the project and vice
versa. In essence, you have circular references. A class in DLL 'A'
uses a class in DLL 'B' and vice versa. This works, since it is
expected to.

* All DLLs are built in debug mode. No 'Release' versions even exist.

* No reference in any DLL has its "Copy Local" set to true. In other
words, a referenced DLL is never copied.

* All DLLs appear in the "Add References" dialog box under the ".NET"
tab. I set up a folder for each DLL in the registry to make this
happen. The folders appear under
HKEY_LOCAL_MACH INE\Software\Mi crosoft\.NETFra mework\Assembly Folders

* The references that I use in the projects loaded in the IDE come
from the .NET tab in the "Add References" dialog box.

* I have verified that the GAC does indeed contain all DLLs and only
single versions of those DLLs.

* Every DLL is built to the \bin\Debug directory and each contains the
..pdb file (used by the IDE for debugging).

With everything setup this way, you would think that logically there
couldn't be a problem. When the IDE runs the main application, it will
notice that a DLL is in the GAC and that the Copy Local is set to
false, so the one in the GAC will be used.

Microsoft has written an article that states that you cannot reference
a DLL in the GAC, which is utterly wrong. I can reference it. They
state that you should copy the DLLs to a common directory and
reference them there. I did do this as well but it didn't help. I even
copied all the .pdb files to the common directory and that didn't help
either. I even set the reference paths in all DLLs to contain the
paths to all other DLLs. It didn't matter whether this path was the
common directory or the bin\Debug directory. It never helped.

What I ultimately discovered is that the only way to make it work is
to set the Copy Local to true. This of course had very serious side
effects. Now the DLLs poliferate all over the place. The same DLL will
appear in multiple directories. While working in the IDE and you
update one DLL, that update will NOT appear automatically in the
directories of other DLLs referencing it. You need to manually update
EVERY DLL use this newer version otherwise the debugging will not
execute. You can press the F5 button on all references in the IDE to
update the version and the newer DLL will get copied to those
directories but you still need to rebuild those other DLLs. Worse yet,
some DLLs may not be loaded in the IDE but are still referenced by
DLLs loaded in the IDE. You will need to update those as well.

This becomes a nightmare. The whole purpose of using a shared DLL is
to avoid duplicates. One version should exist and one only. If
Microsoft is making me copy them to some common directory, I can live
with that, if it would work while debugging in the IDE.

What really ticks me off is that having set the paths to all
references, you would expect the IDE to find the other DLLs and their
dependencies. What in the world am I setting that for if it doesn't
use it? There is no reason, having done all I did, that the IDE should
not find every one of the DLLs and the debug files.

Has anyone got a clue what can be done?

Thanks,
Johann Blake

www.closerworlds.com
Mobile Solutions using GPS
Nov 15 '05 #1
2 2857
Building a set of DLL's with circular references is a very tough process. If
A references B and B references A, the first one to be compiled will
reference a version of the other that will disappear (be overwritten) when
the second is compiled. The resolution will thus fail at load time. You can
assert which DLL fails to resolve using the assembly binding logviewer
(fuslogvw.exe) tool.

For building a project with circular references, you will have to seek for
this topic in the MSDN. I can't remind where I found it.

"Johann Blake" <jb****@closerw orlds.com> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
I can hardly believe I'm the first one to report this, but having gone
through the newsgroup, it appears that way.

I would like to open a solution in the VS.NET IDE that consists of
multiple DLLs and a test application (an .EXE). The .EXE is my startup
application. All the DLLs are shared components. This means that they
contain a key and are stored in the GAC.

When I go to run the test application in the IDE, it will not execute
because it complains that it cannot find the DLL or one of its
dependencies. Here are several pieces of information you need to be
aware of before going any further...

* I use version 1.1 of the .NET Framework (and VS.NET 2003)

* Many of the DLLs reference the other DLLs in the project and vice
versa. In essence, you have circular references. A class in DLL 'A'
uses a class in DLL 'B' and vice versa. This works, since it is
expected to.

* All DLLs are built in debug mode. No 'Release' versions even exist.

* No reference in any DLL has its "Copy Local" set to true. In other
words, a referenced DLL is never copied.

* All DLLs appear in the "Add References" dialog box under the ".NET"
tab. I set up a folder for each DLL in the registry to make this
happen. The folders appear under
HKEY_LOCAL_MACH INE\Software\Mi crosoft\.NETFra mework\Assembly Folders

* The references that I use in the projects loaded in the IDE come
from the .NET tab in the "Add References" dialog box.

* I have verified that the GAC does indeed contain all DLLs and only
single versions of those DLLs.

* Every DLL is built to the \bin\Debug directory and each contains the
.pdb file (used by the IDE for debugging).

With everything setup this way, you would think that logically there
couldn't be a problem. When the IDE runs the main application, it will
notice that a DLL is in the GAC and that the Copy Local is set to
false, so the one in the GAC will be used.

Microsoft has written an article that states that you cannot reference
a DLL in the GAC, which is utterly wrong. I can reference it. They
state that you should copy the DLLs to a common directory and
reference them there. I did do this as well but it didn't help. I even
copied all the .pdb files to the common directory and that didn't help
either. I even set the reference paths in all DLLs to contain the
paths to all other DLLs. It didn't matter whether this path was the
common directory or the bin\Debug directory. It never helped.

What I ultimately discovered is that the only way to make it work is
to set the Copy Local to true. This of course had very serious side
effects. Now the DLLs poliferate all over the place. The same DLL will
appear in multiple directories. While working in the IDE and you
update one DLL, that update will NOT appear automatically in the
directories of other DLLs referencing it. You need to manually update
EVERY DLL use this newer version otherwise the debugging will not
execute. You can press the F5 button on all references in the IDE to
update the version and the newer DLL will get copied to those
directories but you still need to rebuild those other DLLs. Worse yet,
some DLLs may not be loaded in the IDE but are still referenced by
DLLs loaded in the IDE. You will need to update those as well.

This becomes a nightmare. The whole purpose of using a shared DLL is
to avoid duplicates. One version should exist and one only. If
Microsoft is making me copy them to some common directory, I can live
with that, if it would work while debugging in the IDE.

What really ticks me off is that having set the paths to all
references, you would expect the IDE to find the other DLLs and their
dependencies. What in the world am I setting that for if it doesn't
use it? There is no reason, having done all I did, that the IDE should
not find every one of the DLLs and the debug files.

Has anyone got a clue what can be done?

Thanks,
Johann Blake

www.closerworlds.com
Mobile Solutions using GPS

Nov 15 '05 #2
Actually, you won't find it. Circular references between assemblies are
forbidden in .NET.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- ni************* *@exisconsultin g.com

"Jip from Paris" <ji**********@h otmail.com> wrote in message
news:OE******** *****@TK2MSFTNG P10.phx.gbl...
Building a set of DLL's with circular references is a very tough process. If A references B and B references A, the first one to be compiled will
reference a version of the other that will disappear (be overwritten) when
the second is compiled. The resolution will thus fail at load time. You can assert which DLL fails to resolve using the assembly binding logviewer
(fuslogvw.exe) tool.

For building a project with circular references, you will have to seek for
this topic in the MSDN. I can't remind where I found it.

"Johann Blake" <jb****@closerw orlds.com> wrote in message
news:a6******** *************** ***@posting.goo gle.com...
I can hardly believe I'm the first one to report this, but having gone
through the newsgroup, it appears that way.

I would like to open a solution in the VS.NET IDE that consists of
multiple DLLs and a test application (an .EXE). The .EXE is my startup
application. All the DLLs are shared components. This means that they
contain a key and are stored in the GAC.

When I go to run the test application in the IDE, it will not execute
because it complains that it cannot find the DLL or one of its
dependencies. Here are several pieces of information you need to be
aware of before going any further...

* I use version 1.1 of the .NET Framework (and VS.NET 2003)

* Many of the DLLs reference the other DLLs in the project and vice
versa. In essence, you have circular references. A class in DLL 'A'
uses a class in DLL 'B' and vice versa. This works, since it is
expected to.

* All DLLs are built in debug mode. No 'Release' versions even exist.

* No reference in any DLL has its "Copy Local" set to true. In other
words, a referenced DLL is never copied.

* All DLLs appear in the "Add References" dialog box under the ".NET"
tab. I set up a folder for each DLL in the registry to make this
happen. The folders appear under
HKEY_LOCAL_MACH INE\Software\Mi crosoft\.NETFra mework\Assembly Folders

* The references that I use in the projects loaded in the IDE come
from the .NET tab in the "Add References" dialog box.

* I have verified that the GAC does indeed contain all DLLs and only
single versions of those DLLs.

* Every DLL is built to the \bin\Debug directory and each contains the
.pdb file (used by the IDE for debugging).

With everything setup this way, you would think that logically there
couldn't be a problem. When the IDE runs the main application, it will
notice that a DLL is in the GAC and that the Copy Local is set to
false, so the one in the GAC will be used.

Microsoft has written an article that states that you cannot reference
a DLL in the GAC, which is utterly wrong. I can reference it. They
state that you should copy the DLLs to a common directory and
reference them there. I did do this as well but it didn't help. I even
copied all the .pdb files to the common directory and that didn't help
either. I even set the reference paths in all DLLs to contain the
paths to all other DLLs. It didn't matter whether this path was the
common directory or the bin\Debug directory. It never helped.

What I ultimately discovered is that the only way to make it work is
to set the Copy Local to true. This of course had very serious side
effects. Now the DLLs poliferate all over the place. The same DLL will
appear in multiple directories. While working in the IDE and you
update one DLL, that update will NOT appear automatically in the
directories of other DLLs referencing it. You need to manually update
EVERY DLL use this newer version otherwise the debugging will not
execute. You can press the F5 button on all references in the IDE to
update the version and the newer DLL will get copied to those
directories but you still need to rebuild those other DLLs. Worse yet,
some DLLs may not be loaded in the IDE but are still referenced by
DLLs loaded in the IDE. You will need to update those as well.

This becomes a nightmare. The whole purpose of using a shared DLL is
to avoid duplicates. One version should exist and one only. If
Microsoft is making me copy them to some common directory, I can live
with that, if it would work while debugging in the IDE.

What really ticks me off is that having set the paths to all
references, you would expect the IDE to find the other DLLs and their
dependencies. What in the world am I setting that for if it doesn't
use it? There is no reason, having done all I did, that the IDE should
not find every one of the DLLs and the debug files.

Has anyone got a clue what can be done?

Thanks,
Johann Blake

www.closerworlds.com
Mobile Solutions using GPS


Nov 15 '05 #3

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

Similar topics

0
3226
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
2
2254
by: njr | last post by:
Having copied a number of folders from my development PC (XP) to a development server (W2003) and installed them under wwwroot (and created applications in IIS) I have problems when I include the corresponding asp.net projects in a solution. They build fine but when attempting debug (via F5) I get "Load of property 'Output Path' failed. The 'Output Path' must be under the project folder". The really strange thing though is that two...
4
3532
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
2
6655
by: Samuel L Matzen | last post by:
Hi, I am trying to develop with multiple projects in a single solution. The many of these projects create .dlls that are used by other projects. When I reference a .dll I reference it in the bin directory of the project creating it. The problem I am having is that Visual Studio keeps throwing a whole bunch of error messages indicateing it can't overrite other version of dlls and that one object can't be converted to another object...
6
2204
by: Brian Bischof | last post by:
I'm having troubles getting the debugging process to work consistenly for external classes. I got it to work once and then I turned it off. But now I can't get re-enabled. Here is what I'm doing. If someone could tell me what I'm missing that would be great. 1. Create an external class and call it Test.dll. 2. Create a test Asp.net app called App.sln. 3. For App.sln I set a reference to Test.dll. 4. Compile App.sln and run it. The web...
6
5348
by: Alex | last post by:
Hello people, We have a large application (about 5000 source files) consisting of multiple executables, DLLs and COM components written in C++. We develop and build it in Visual Studio 2003. I'm in charge of evaluating whether we want to migrate it to VS2005 (the previous migration from 6.0 to 7.1 was a pain). So far, things do not look good. I installed VS2005 on a VM, copied the sources over and tried to build the solution.
3
2075
by: Claudio Pacciarini | last post by:
Hi everyone, I have a question about .NET code sharing and reuse, and also about application design best practices / guidelines. Currently, we have many different .NET projects in source depot. Although they are different, in some of them we share C# code by referencing source files that are external (not part of the projects) on each project. For instance, some of our projects have the typical “sources” file with:
3
2779
by: Phaitour | last post by:
Hi there, I'm working on developing a large Class Library project that is slowly becoming a shared "framework" library amongst multiple applications. As this shared library grows, I need to start thinking about ways to split this library up. In observing the .net framework, I've noticed that each major branch of the framework (eg. System.Net or System.Data) and even some of the minor branches are split up into individual dlls. When...
0
1320
by: Robson Siqueira | last post by:
Guys, I am facing a weird problem. When I am debugging a solution with multiple projects, I always receive the message "the breakpoint will not currently be hit. the source code is different from the original version." or something like that. In my solution, I have the business logic in a DLL and I use it in web services and windows form applications. I keep using the Clean / Build operation repeatedly and sometimes it works,...
0
8888
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
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
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
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
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.