MrBill
MrBill

Reputation: 100

Using VB.NET, how can I bring an existing project in an existing solution into a new solution so that it resides completely within the new solution?

I am creating an application which will coordinate and organize a lot of standalone functions. For instance, the main application might be called ABC Company Operations, and within it might be Engineering Bills Of Material and Project Management Purchase Orders, among many others. I want to develop each of these tools as a standalone solution, then include them in the main application when I am done with them. For one thing this will allow me to distribute the main application with a fair number of tools complete, then issue an update when each new one is included, and for another thing having these functions in their own projects will cut down on the madness inside the solution explorer.

Searching and reading have shown me how to include existing projects in a solution, but they are included as a reference - the files continue to reside in the standalone solution. This is not good because I wish to make any changes needed in the standalone, then replace the project in the main solution when those changes are done and also because I would prefer not to have all these solutions hanging around in a public place.

I tried just copying and pasting the project directory from the standalone solution into the main solution, but the solution explorer hasn't picked it up and there are somehow two listings of the standalone in the main Visual Studio screen where you select which solution you will work on. This seems like a bad road, so before I continue down it I would like to ask for any advice you folk may have.

Upvotes: 0

Views: 1285

Answers (2)

Olivier Jacot-Descombes
Olivier Jacot-Descombes

Reputation: 112279

Visual Studio allows you to reference the same project in different solutions.

Right click the solution in the solution explorer > Add > Existing Project...

I have done it and it works perfectly.


But very often referencing the DLL of a class library project is just enough. Usually you would reference the bin\Release version. You can even reference an EXE.

Upvotes: 1

Brian Hooper
Brian Hooper

Reputation: 22044

I achieve something like what you want by using the Subversion code management system. I keep each project in a directory. These are top-level directories in the Subversion repository.

Each solution is also a top-level entry in the Subversion repository, but does not have any projects in with it. So I have in my repository something like this:-

project directory
    project
    files directory
        files

project directory
    project
    files directory
        files

single-project-solution directory
    single-project solution

single-project-solution directory
    single-project-solution

multiple-project solution directory
    multiple-project solution

I then use svn:externals to include all the needful project directories when either a single project solution or a multiple project solution is checked out, and it ends up in the working copy like this:-

multiple-project solution directory
    multiple-project solution
    project directory
        project
        files directory
            files
    project directory
        project
        files directory
            files

or

single-project-solution directory
    single-project-solution
    project directory
        project
        files directory
            files

Upvotes: 1

Related Questions