WinForms Solution with Multiple Projects

Posted on 2012-08-28
Last Modified: 2012-08-28
I'm building a solution that has a primary project, and I want to add multiple "child" projects.

Currently, the child project is seperate, I compile the class into a DLL, copied the dll over to the main solution, referenced it, included in project and everything works fine.

My question is...

If I add the child project...and have it compile to the Solution Bin directory...will it be "seen" correctly?

And how do I deploy the executable so that the the compiled dll doesn't have to go with it?
Question by:lrbrister
    LVL 2

    Expert Comment

    If you add the child project to the solution you should change the refereces of the main project. Instead of referece a dll the main project should refereces a project (the child one)

    Then, every time you compile the solution, you will have the "current" child dll.

    Otherwise, the project is not going to see the dll.
    LVL 83

    Expert Comment

    One option, as described above, is to use a Project reference instead of assembly reference if both projects are in same solution. If you don't want to do that, you can add code in PostBuild event so that newly compiled dll is copied to your primary project's Bin folder.

    >And how do I deploy the executable so that the the compiled dll doesn't have to go with it?

    Not sure what you mean.

    Author Comment


    I guess what I'm asking is...
    On a basic build where an exe is built and the dll is referenced.

    Do they both need to be copied to a Client PC?
    Or just the exe?

    You've been a tremendous help over the years as I've gotten better and better in Web Apps.

    I'm in a job now where I may need to build WinForm apps
    LVL 83

    Accepted Solution

    Yes you need to copy the DLL as well to the target machine. Simplist way is to keep the DLL in same folder as exe.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    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.…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now