Reputation: 1155
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.
Upvotes: 2
Views: 3002
Reputation: 529
You probably figured out in the past 5 years, but here is the answer:
To have one big .sln
umbrella, you need to make sure the "Place solution and project in the same directory" checkbox is unchecked:
Otherwise you end up with this:
repos
|- Project1/
| |- Project1.sln
| |-src/
| |- main1.c
|- Project2/
|-src/
|- main2.c
As you see, when the checkbox is checked, you are not able to change the solution name:
This relates with your "creating a dummy project, then delete it" issue. When the checkbox is unchecked, just change the Solution Name:
Upvotes: 0
Reputation: 36082
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.
Upvotes: 2