Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent copying dlls 1

Status
Not open for further replies.

xwb

Programmer
Jul 11, 2002
6,828
GB
I'm working on a fairly big project with lots of C# dlls. The sources are about 500Mb. By the time it finishes building, the system is about 10Gb, most of it being copies of the same dll. There are 170 copies of some of the DLLs!

There doesn't seem to be a concept of "stick all your dlls in one place". Each project takes copies of the dlls it is dependent upon as part of the build. With a project this size it goes out of sync very quickly and visual studio doesn't clean up properly either. I've had to resort to external scripts to do the tidying up.

What I'm looking for is a way of sticking all the dlls in one directory and referencing them instead of local copies. Does such a concept exist in Visual Studio?
 
For the DLL to run without being in the programs directory, you need to have the DLL registered in windows, I actually posted about this before and I'll find the thread where I asked the same thing. But I know you cant do this without registering the DLL
 
I love coming across answers that I completely forgot about

:)

Be aware that having the same dll registered globally and having one in your application directory really can cause some crazy effects - at least this was the case working with a C++ Wrapped DLL.

 
That isn't the question - question is how I can build a C# solution with lots of projects without the solution copying DLLs from one directory to another during the build process.

In C++, it is quite easy but I haven't figured out how to achieve this in C#.
 
How many projects do you have in your solution? Do they all rely on eachother?

If you have 3rd party dlls then register them (regsvr32 or regasm). If you only have your own built dlls then I think you have a problem as no project should have that many dlls.

If you have a project in visual studio and you only need some of the projects to build and be copied then you should look into the Configuration Manager in visual studio and tell some of the projects not to build.

Are you writing an OS?

 
About 200 projects in the solution, 130 of which are C# and the rest a mix of managed C++, C++, C and database. Some do rely on others. It is a hierarchal structure. There aren't any 3rd party DLLs.

It isn't an OS - just a very big product. It takes 4 hours to build on a dedicated 3GHz machine with 1Gb memory. We do a build every night. The delivered executables + DLLs + examples + help comes up to 2 CDs. That is roughly 1.4Gb.

The problem I'm finding is that the DLLs are going out of sync so whenever I rebuild a dll, I delete the 100+ copies first so that any dependencies get rebuilt. If I just rebuild the DLL in the csproj, the program gets screwed.
 
have you tried - right click the reference to the dll and go to properties then change the copy locally to false. Not sure if that will work but worth a go.

Age is a consequence of experience
 
Haven't tried that before. Don't recall ever seeing that option. As always, it probably has been there since day one but I just haven't noticed it. I'll give it a go tomorrow.
 
Tried it on a small selection and it does work. Thanks for that.
 
glad i could help, thx.

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top