1

I would create a Visual Studio C solution, with this kind of structure under a parent directory:

Parent/
|
|- SolutionName.sln
|
|- Project1/
|     |
|     |-src/
|        |
|        |- main1.c
|
|- Project2/
     |
     |-src/
        |
        |- main2.c

How to do this please?

Already tried multiple things, like creating a solution then Add Project etc, but this generally ends up with the .sln in one of the subdirectories; which doesn't reflects the solution structure - all projects are under one big .sln umbrella.

There are already on SO a dozen questions around "multiple projects", but no one had answered this simple question.

1 Answer 1

2

When you create your first project and solution, the solution gets the name of the first project. Any projects added later are stored under that name.

MyFirstProject
   +---------------MyFirstProject
   +---------------MySecondProject
...

The parent dir, MyFirstProject contains the .sln file, the subdirs contain the project files.

I would suggest you follow the general setup that Visual Studio uses instead of creating your own custom one for convenience.

2
  • 1
    Ok, this is at least a workaround +1 . Problem is that one of the projects would have a privilegied position amongst others. I managed creating a dummy 'project', same name as solution, and then adding other projects....
    – yO_
    Jan 22, 2019 at 14:14
  • @yO_ yes that would do it.
    – AndersK
    Jan 22, 2019 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.