473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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_MACHINE\Software\Microsoft\.NETFramewor k\AssemblyFolders

* 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 2823
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****@closerworlds.com> wrote in message
news:a6**************************@posting.google.c om...
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_MACHINE\Software\Microsoft\.NETFramewor k\AssemblyFolders

* 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**************@exisconsulting.com

"Jip from Paris" <ji**********@hotmail.com> wrote in message
news:OE*************@TK2MSFTNGP10.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****@closerworlds.com> wrote in message
news:a6**************************@posting.google.c om...
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_MACHINE\Software\Microsoft\.NETFramewor k\AssemblyFolders

* 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
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...
2
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...
4
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...
2
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...
6
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....
6
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. ...
3
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...
3
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.