dotnet / dotnet/sdk

`dotnet run` can use the .slnx `DefaultStartup` property

Open
#55,139 1 comment 1 reaction 0 assignees View on GitHub
Area-Run untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Is your feature request related to a problem?

Using `dotnet run` in a directory where there's only a solution or `dotnet run solution.slnx` currently shows an error:
> Couldn't find a project to run. Ensure a project exists in , or pass the path to the project using --project.

### Describe the solution you'd like

The .slnx format has the option to specify the startup project using ``. If there's a single one, `dotnet run` can use it to run the project.

### Alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how `dotnet run` handles a directory containing only a solution and how it parses `.slnx` project entries. Verify the `DefaultStartup="true"` selection when exactly one project is marked, including `dotnet run solution.slnx`; done when that project runs while the existing error remains appropriate when no usable startup project is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.