Referencing DLLs to distribute

  • Thread starter Thread starter Doug Crabtree
  • Start date Start date
D

Doug Crabtree

I am kinda new to the whole distribution process.

I several programs that I am writing that use common .NET DLLs. I want
each program to use the same DLLs in a "COMMON" folder. How do I get
the released build to reference those DLLs?

The debug version works fine (within the VS Environment).

Thanks,
Doug
 
Doug,

You need to keep the common DLLs in the same folder as the release EXE.
Another option would be to install the common DLLs into the Global
Assembly Cache, but this makes deployment slightly more complicated.

You may want to check into creating a Setup and Deployment project;
this will allow you to build a simple MSI for distributing your
application.

HTH
Andy
 
You mean to have a copy of the DLL for each EXE that I am writing?
Seems like kind of a waste of space. I was hoping to have a common
directory.

Thanks,
Doug
 
Yes. Are the release versions of your assemblies large? Space
shouldn't really be an issue.

If you really want to, you can deploy the assemblies to the Global
Assembly Cache, but you may run into other problems there. For
starters, your assembly must be signed with a strong name.

Secondly, if you deploy an updated version of your assembly, any
existing programs will continue to use the OLD version (since you ARE
allowed to have multiple versions of an assembly within the GAC)
unless you change your .config file to redirect to the newest version.

While you're developing though there's no reason you can't store your
release DLLs on a share somewhere and have your projects reference
those. Thats what i do here, to ensure i'm always building against the
latest version of an assembly.

Andy
 
I know you've had other answers but just as a sanity check... Are you
thinking of the .NET DLL's in a common folder??

If this is the case and you are trying to figure out how to redistribute the
framework, stop now. The framework DLL's are contained in the Global
Assembly Cache (GAC) and willl be referenced automatically by the CLR.

For your own DLL's that you might create as a part of your project,
distribute them in the application directory OR, if you have several
applications that depend on the same DLL's, strong-name them and put them in
the GAC.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
NO! the DLL's are already in a system folder called the Global Assembly
Cache. .NET applications declare which version of a DLL must be used and the
runtime manager, the CLR, will dynamically link the correct version DLL for
you. You do not need to redistribute bits of the framework with your
application.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Bob,

Just to be clear, I'm assuming Doug is talking about assemblies he
himself is building, not assemblies that are part of the .Net
framework.

Andy
 
You are correct. I have several applications that use the same custom
DLLs over and over again. Just didn't want to have have them in all of
the directories. They are not large, and I don't want the headache of
the GAC. Maybe I will just have all the EXEs in the same directory,
since I will have to rebuild all of them each time I change the base
DLLs.

Thanks,
Doug
 
If tthese are your own DLL's and they span applications take 5 minutes to
strong name them and install them in the GAC.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top