denn4617
denn4617

Reputation: 393

Multiple Startup projects in Solution, in Rider

I'm working on a project for a upcoming job interview. I'm used to writing C# in Visual Studio, but since I've changed to Linux, I'm trying to use Rider.

In Visual Studio you can add multiple projects as your 'Startup Project', and I'm not sure how to do this in Rider.

My file structure is:

BlazorApp
│   README.md
│   .gitignore    
│
└───MyApp.Web(Blazor project)
│
│___MyApp.Api(ASP.NET Core Web App with the API template)
│   
└───MyApp.Models(Class library)

Where MyApp.Api should start first and afterwards MyApp.Web.

Upvotes: 38

Views: 13890

Answers (2)

Daniel Jonsson
Daniel Jonsson

Reputation: 3931

In Rider 2023.3, they have added Multi-Launch configuration, which allows you to start two or more projects in an order that you specify yourself. With the previous Compound configuration, you were not able to specify the launch order of the projects. So if this is something you need, check it out. You can read about how to set it up on https://www.jetbrains.com/help/rider/2023.3/Run_Debug_Multiple.html#multi_launch.

Here's a GIF from the documentation, which shows how to run multiple projects using the Multi-Launch configuration:

Gif image showing how to set up multi project launch in Rider

And here's a copy of the text that explains the steps:

Documentation of how to run multiple projects

Upvotes: 8

ChiefTwoPencils
ChiefTwoPencils

Reputation: 13940

  1. In the run config drop down, select "Edit Configuration..."
  2. At the top of the left hand menu, click "+"
  3. Find and select "Compound"
  4. Name it
  5. Use the "+" button to add the projects you'd like to start together
  6. Select that configuration when you run it

Edit the confuration:
enter image description here

Find and select the Compound configuration:
enter image description here

Add the projects:
enter image description here

Select it when you run it:
enter image description here

Note


The compound configuration is just a grouping of existing run configurations so if you need to set environment variables or program or runtime arguments, you can:

  1. In the run config drop down, select "Edit Configuration..."
  2. Click on the run configuration you need to update from the left hand menu
  3. Make the desired updates on the right hand side
  4. Save the changes.

enter image description here

Upvotes: 68

Related Questions