Skip to content

Commit 97d9ed0

Browse files
Merge pull request #13252 from ghogen/multi-project-launch
Add coverage of multi-project launch profiles
2 parents 8f43273 + d04c5c2 commit 97d9ed0

File tree

7 files changed

+74
-2
lines changed

7 files changed

+74
-2
lines changed

docs/ide/how-to-set-multiple-startup-projects.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Set multiple startup projects'
3-
description: Discover the Visual Studio process that allows you to specify how more than one project is run when you start the debugger.
4-
ms.date: 11/01/2023
3+
description: Discover the Visual Studio process that allows you to specify how more than one project is run when you start the debugger, and create launch profiles you can share with others.
4+
ms.date: 10/21/2024
55
ms.topic: how-to
66
helpviewer_keywords:
77
- startup projects, setting multiple startup projects
@@ -28,6 +28,78 @@ Some project templates include multiple projects that are already configured to
2828

2929
4. Choose the **Multiple Startup Projects** option and set the appropriate actions.
3030

31+
## Multi-project launch profiles
32+
33+
You can set up and save profiles for launching specific projects within a multi-project solution in predefined states for debugging. This simplifies the process of working with complex solutions, improves debugging efficiency, and enables easy sharing of configurations among team members.
34+
35+
### Enable multi-project launch profile
36+
37+
Multi-project launch profiles are available in Visual Studio 2022 17.11 and later. To enable or disable the **Multi-project Launch Profiles** feature, go to **Tools > Options > Preview Features** and toggle the checkbox for **Enable Multi Launch Profiles**.
38+
39+
:::image type="content" source="media/launch-multiple-projects/tools-options-enable-multi-project-launch.png" alt-text="Screenshot showing the option to enable Multi-project Launch Profiles in the Tools Options dialog." border="true":::
40+
41+
### Create a multi-project launch profile
42+
43+
1. Open your Visual Studio solution that contains multiple projects.
44+
1. In Solution Explorer, right-click on your solution, and select **Configure Startup Projects...**.
45+
46+
You can also press **Ctrl**+**Q** (Quick Launch) and search for "Configure startup projects" in Feature Search.
47+
48+
:::image type="content" source="media/launch-multiple-projects/quick-launch-configure-startup-projects.png" alt-text="Screenshot showing searching for configure startup projects in Feature Search." border="true" :::
49+
50+
The **Solution Property Pages** dialog appears.
51+
52+
1. In the Solution Property Pages, click on the **Common Properties** tab, and select **Configure Startup Projects**.
53+
1. In the **Configure Startup Projects** section, choose the **Multiple startup projects** radio button.
54+
55+
:::image type="content" source="media/launch-multiple-projects/solution-property-pages.jpg" alt-text="Screenshot showing the Multiple startup projects radio button." border="true" lightbox="media/launch-multiple-projects/solution-property-pages.jpg":::
56+
57+
Below the radio button, you'll see a list of all the projects in your solution, and whether they are set to be launched or not when you press **F5**, and whether each project is started under the debugger or without debugging.
58+
59+
You can use the up and down arrows to control the order in which projects will be launched.
60+
61+
1. Set the action for each project to either **Start**, **Start without debugging**, or **None**, and select a debug target depending on your requirements.
62+
63+
![Screenshot showing the options for starting a project.](media/launch-multiple-projects/launch-profiles-start-options.png)
64+
65+
1. Enable the **Share Profile** checkbox if you want to share the profile with other Visual Studio users by checking it into the configuration file in the Source Control repo.
66+
Launch profiles are saved to a JSON file with the extension `.slnLaunch` in the same directory as the solution. The **Share Profile** checkbox determines whether the profile is saved to a user-specific file (unchecked) or to a file intended for source control tracking, such as in Git (checked).
67+
68+
:::image type="content" source="media/launch-multiple-projects/share-profile.png" alt-text="Screenshot that shows the Share Profile checkbox on the Solution Property pages dialog." border="true":::
69+
70+
Here's an example of the profile in the `.slnLaunch` file:
71+
72+
```json
73+
[
74+
{
75+
"Name": "Feature Profile",
76+
"Projects": [
77+
{
78+
"Path": "src\\OrchardCore.Cms.Web\\OrchardCore.Cms.Web.csproj",
79+
"Action": "Start"
80+
},
81+
{
82+
"Path": "src\\OrchardCore\\OrchardCore.DisplayManagement\\OrchardCore.DisplayManagement.csproj",
83+
"Action": "Start"
84+
},
85+
{
86+
"Path": "src\\OrchardCore\\OrchardCore.Data\\OrchardCore.Data.csproj",
87+
"Action": "StartWithoutDebugging"
88+
},
89+
{
90+
"Path": "src\\OrchardCore\\OrchardCore.ContentManagement.Display\\OrchardCore.ContentManagement.Display.csproj",
91+
"Action": "Start"
92+
}
93+
]
94+
}
95+
]
96+
```
97+
98+
1. Once you've configured the startup action for each project, click the **OK** or **Apply** button to save the profile.
99+
The created launch profile appears in the toolbar dropdown list, allowing you to select the profile you want to debug.
100+
101+
:::image type="content" source="media/launch-multiple-projects/profile-in-toolbar.png" alt-text="Screenshot showing launch profile in toolbar.":::
102+
31103
## With Docker Compose
32104

33105
When you're using Docker Compose to launch containerized projects on a local machine, you use a different method (launch profiles) to start multiple projects.
88.3 KB
Loading
27.8 KB
Loading
148 KB
Loading
96.2 KB
Loading
329 KB
Loading
68.7 KB
Loading

0 commit comments

Comments
 (0)