Include a Visual Studio solution into another VS solution?

Micha Vosse 26 Reputation points
2023-04-03T13:51:52.65+00:00

Hey,

I have the following setting:

  • VS Solution Core.sln
    • Core Project 0
    • Core Project 1
    • etc.
  • VS Solution Customer 0.sln
    • Customer Project 0
    • Cusotmer Project 1
    • etc.
  • VS Solution Customer 1.sln
      • Customer Project 2
    • Customer Project 3
    • etc.

Now I want that every customer solution has access to every project in the core solution. The core project is included into customer solutions as a git submodule, so a specific customer looks like this:

  • VS Solution Customer 0.sln
    • Customer Project 0
    • Customer Project 1
    • Core/
      • VS Solution Core.sln
        • Core Project 0
        • Core Project 1

Currently I add each Core project manually as "add existing project" into customer solutions.

Is there a way to link the customer solution with the core solution? So that everytime the core gets a new/ updated project, this project is automatically available in all customer solutions?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,690 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Yoann Blossier 0 Reputation points
    2023-04-04T06:44:36.8266667+00:00

    Hi, Your need is understandable but nor realizable because solution can't be include in another solution BUT you have solutions :

    1. Include the CORE projects in any solutions need them (maybe in a solution folder to organize tree)
    2. Reference your CORE libraries instead projects. At the end the results will be the code is used in your projects

    Ask if you need illustrations ;-)


  2. Anna Xiu-MSFT 26,566 Reputation points Microsoft Vendor
    2023-04-04T07:14:16.9133333+00:00

    Hi @Micha Vosse

    Welcome to Microsoft Q&A! 

    Which version of Visual Studio are you using? 

    You can refer to the blog: Walkthrough: Adding an existing Visual Studio solution to another solution

    If you are unable to change the file type to “Solution (*.sln)”, please try to directly type “*.sln” in File name and the solution will appear. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Johan Andersson 0 Reputation points
    2024-01-24T10:00:05.97+00:00
    0 comments No comments