473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP!! I'm having "DLL Hell" in .NET

Hello,

We have a small team building a project that involves some 30 or so c#
assembly dlls. It is a client server application with 1 exe as the
starting point. The dlls and exe are sharing an assemblyinfo file that
has a strong name and version assiciated with it. We are having
problems in the way we have been developing. We have made two attempts
at this.

Attempt 1) In our first attempt, we basically had 1 folder that
contained all the output assemblies. This used to be the way we did
things in COM, but this causes us to have to re-compile every
dependant project when we make changes. I thought .NET was supposed to
solve this? On top of this, every dll get's locked by Visual Studio.
This means it becomes difficult to open more than one Visual Studio
project at once (another thing we used to do frequently in COM with no
problems). We had all "copy local = false" set for all references
since they all pointed to one output directory. We even tried
variations of the copy local settings depending on whether the project
was the starting main exe or a referenced assembly. We just couldn't
get it right so we did some research on the web and switched to
Attempt 2.

Attempt 2) Now we have each assembly pointing to it's own output
directory in a hierarchy format. The exe is the root directory with
all the supporting assemblies in directories in the root. We have
been very conscious that the reference paths are all in the corect
order to make sure the correct asssemblies are being referenced. This
means that each assembly has (in it's output folder) a copy of the
assemblies it needs. This is accomplished because we set copy local =
true for each reference in these assemblies. The exception is the main
executable. In here we have all the assembly references set to copy
local = false. We found this approach on the web and it seemed that
this was the nirvana we were seeking. But the reality is that we were
still having problems. We cannot compile any core assembly without
having to re-complile every dll that references it. In COM, there was
the concept of binary compatibility which allowed us to compile core
dlls as long as it didn't break the Interface (i.e. we could do
internal changes and/or add methods and properties). I'm thinking .NET
should be at least this good if not better. On top of this, we now
have to manage our reference paths hiarchy. Since the main executable
points to each output folder, the order of the reference paths is
crucial since core dlls show up several times (from the perspective of
the main exe). We are also very consious of the project build order
settings which are set correctly.

So in short, both methods yield COM like results (if not worse). And
many times we won't find the errors until run-time which is even
worse. We'll get assembly IO errors due to assembly manifests
version's not matching. We also occasionally get dll locking issues
caused by a number of reasons such as User Controls and having
multiple Visual Studio's open.

I'm convinced that there is a correct way to do this. Is there a 3rd
way that we should be developing or is one of our first two attempts
close but not exactly right?

Any help would be greatly appreciated.

Thanks,
Dave
Nov 22 '05 #1
1 1788
Ahhhh!

Finally, we got everything working. The problem was we were trying to
get too cute. Here is a list of problems we were doing wrong which
compounded our problems, so if you're having similar problems please
advise:

1) Use the default Build Paths Microsoft provides in each of your
projects. This is extremely important and in fact, Microsoft has a
huge known bug if you don't do this (and your dlls are larger than
64kb). Check out this article for more details:
http://support.microsoft.com/?id=313512. We were getting bit by this
one big time.

2) Very related to #1, leave CopyLocal = true for all referenced
projects.

3) All references should be done by project rather than by dll (unless
of course it is a 3rd party dll). This yields several advantages and
has no down sides (that I know of). One of the biggest advantages is
that Visual Studio can determine your build order.

4) What this allows you to do is basically have every project open in
1 solution. Then, Visual Studio will figure out what needs to be
compiled and when. This is a movement away from the way I remember
teams developing in COM. In otherwords, the dlls are now arbitrary and
the heart of everything is the code.
ch********@yaho o.com (malcolm) wrote in message news:<4f******* *************** ****@posting.go ogle.com>...
Hello,

We have a small team building a project that involves some 30 or so c#
assembly dlls. It is a client server application with 1 exe as the
starting point. The dlls and exe are sharing an assemblyinfo file that
has a strong name and version assiciated with it. We are having
problems in the way we have been developing. We have made two attempts
at this.

Attempt 1) In our first attempt, we basically had 1 folder that
contained all the output assemblies. This used to be the way we did
things in COM, but this causes us to have to re-compile every
dependant project when we make changes. I thought .NET was supposed to
solve this? On top of this, every dll get's locked by Visual Studio.
This means it becomes difficult to open more than one Visual Studio
project at once (another thing we used to do frequently in COM with no
problems). We had all "copy local = false" set for all references
since they all pointed to one output directory. We even tried
variations of the copy local settings depending on whether the project
was the starting main exe or a referenced assembly. We just couldn't
get it right so we did some research on the web and switched to
Attempt 2.

Attempt 2) Now we have each assembly pointing to it's own output
directory in a hierarchy format. The exe is the root directory with
all the supporting assemblies in directories in the root. We have
been very conscious that the reference paths are all in the corect
order to make sure the correct asssemblies are being referenced. This
means that each assembly has (in it's output folder) a copy of the
assemblies it needs. This is accomplished because we set copy local =
true for each reference in these assemblies. The exception is the main
executable. In here we have all the assembly references set to copy
local = false. We found this approach on the web and it seemed that
this was the nirvana we were seeking. But the reality is that we were
still having problems. We cannot compile any core assembly without
having to re-complile every dll that references it. In COM, there was
the concept of binary compatibility which allowed us to compile core
dlls as long as it didn't break the Interface (i.e. we could do
internal changes and/or add methods and properties). I'm thinking .NET
should be at least this good if not better. On top of this, we now
have to manage our reference paths hiarchy. Since the main executable
points to each output folder, the order of the reference paths is
crucial since core dlls show up several times (from the perspective of
the main exe). We are also very consious of the project build order
settings which are set correctly.

So in short, both methods yield COM like results (if not worse). And
many times we won't find the errors until run-time which is even
worse. We'll get assembly IO errors due to assembly manifests
version's not matching. We also occasionally get dll locking issues
caused by a number of reasons such as User Controls and having
multiple Visual Studio's open.

I'm convinced that there is a correct way to do this. Is there a 3rd
way that we should be developing or is one of our first two attempts
close but not exactly right?

Any help would be greatly appreciated.

Thanks,
Dave

Nov 22 '05 #2

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

Similar topics

1
1596
by: Dino | last post by:
hello, every night i'm running a simple cronjob which created sql-dumps from serevral web applications using a syntax like this: mysqldump --add-drop-table -uuzzer -hmyhost -pmypw mydatabase table1 table2 table3 > dumpme.sql after this, the sql-dump is packed together with the pages of the website, creating a whole backup-archive.
1
354
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an assemblyinfo file that has a strong name and version assiciated with it. We are having problems in the way we have been developing. We have made two attempts at this. Attempt 1) In our first attempt, we basically had 1 folder that
2
1589
by: n8wei | last post by:
Hi, I seem to be having a bit of a problem serializing a complex object into XML. I've done this many times with simpler objects and it's always worked just fine. The error I'm getting is the natorious "File or assembly name .dll, or one of its dependencies was not found. I have turned on XML Serialization debugging int the web.config file, so I have all of the output generated by the serializer.
2
4536
by: Jozef | last post by:
Hello, I am trying to put together a module and open a workspace on a database that has a simple password (using Access XP). This is the lin that I'm having trouble with; Set wrk = CreateWorkspace("TestWrkspc", "Admin", conDbPwd) conDBPwd is a variable that contains the password. There is no independant workgroup file, just the default. This is the error message I'm getting;
0
1534
by: Kent P. Iler | last post by:
Hi, I have a data repeater that is returning a list of events. One of the things I want to do is give the user a way to edit or delete an event. My plan was to use an Imagebutton that would invoke a codebehind function that would either edit or delete the item. My problem is I need to pass the event_id as a parameter to each of these functions so I know what event to edit/delete. The error code is complaining about the way I'm trying...
15
2077
by: DavidS | last post by:
Have Visual Studio.NET installed on MS 2000 Professional OS laptop. No issue ever with web development and SQL connections. Purchased new laptop with XP Professional SP2!!!!!!!! & Visual Studio.NET installed. Nothing but headaches. Continually getting System.Data.SqlClient.SqlException : Timeout expired message - The timeout period elapsed prior to completion of the operation or the server is not responding. Can anyone help with...
8
2631
by: Xu, Wei | last post by:
Hi, I have wrote the following sql sentence.Do you have comments to improve the performance.I have created all the indexed. But it's still very slow.Thanks The primary key is proj_ID and Task_UID. SELECT PR.PROJ_NAME AS PRName, PR.PROJ_ID As PRProjID, PR.TASK_UID As PRTaskUID, 'Dev' AS GroupType, Feat.PROJ_ID As FeatProjID, Feat.TASK_UID As FeatTaskUID, Feat.FeatureID AS FeatureID,
1
922
by: wilsonbell | last post by:
I've just written my first call out and it supposed to be simple, but I can't get it to work, and of course, I can't debug it. I'm not getting errors in the Event log, and I can't be sure what messages in the Event log are being generated by the execution of the call out. I think the config file is correct. I really need help with this quickly. Any thoughts or ideas would be appreciated greatly. Wilson Bell
2
1131
by: fuyumi87 | last post by:
Hi, I am currently making a list, where users can click the Add-button to add stuffs to the list, and click the Delete-button to delete the selected item. However, because it starts with an Empty list, I want the Delete-button to disable at first. (see the third line with "<<< check").. then it will enable as long as there is one item in the list. but if the user deletes all the items, it will go back to disable form. But somehow, it is...
0
7959
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
7883
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
8379
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...
1
8021
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
6677
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
5842
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
5421
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2393
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
1
1492
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.