Create one DLL from a solution with two or more projects

Posted on 2010-01-08
Last Modified: 2013-11-26
I have a solution that currently has two projects.  Each project is a class library.  When I build the solution, two DLLs are created, one for each project.  I would like to build the solution and produce one DLL that incorporates both class libraries.  Can this be done from within Visual Studio 2008 or do I need to use something like ILmerge?
Question by:Kramarich
    LVL 15

    Expert Comment

    Put all the class in one project, don't split it into two project, If you want to produce one dll.

    That is I think the simplest thing to do.


    LVL 15

    Expert Comment

    Merging .NET assemblies using ILMerge
    LVL 5

    Accepted Solution

    i don't know how to merge the files but you can combine them into one namespace. to do this go to project properties and change the root namespace to make them the same. just make sure that everything is named so that there are no duplicates.

    Author Comment

    Thanks all.
    Jack, thanks.  I thought of combining the projects but it just bugged me that I couldn't keep separate projects and have one dll.
    x77, thanks.  This might be the way I have to do this but you would think there would be a way to do this from within the VS solution.
    vb student, thanks.  I tried this but I still ended up with two DLLs - unless I did something wrong.  I'll have to play around with this a little more.  Maybe two DLLs will work after all.
    Thanks again everyone!

    Author Comment

    Update.  It turns out that using the same name for the Root namespace in each project worked for me.  It didn't give me one DLL but it did place both projects into the same root namespace which I can live with.

    Author Closing Comment


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now