run-default runs the project marked DefaultStartup in a .slnx solution, matching Visual Studio's startup-project behavior.
This will be unecessary once dotnet/sdk #55139 (dotnet run can use the .slnx DefaultStartup property) is implemented.
run-default targets .NET 10. Install a compatible .NET SDK or runtime before using it.
dotnet tool install --global dotnet-run-defaultUpdate an existing installation:
dotnet tool update --global dotnet-run-defaultBuild the tool package:
dotnet pack -c ReleaseIn a repository where you want to use it, create a local tool manifest if needed and install from the package output:
dotnet new tool-manifest
dotnet tool install --local --add-source <path-to-dotnet-run-default>\src\bin\Release dotnet-run-defaultMark a project as the default startup project in the .slnx file:
<Project Path="src/MyApp/MyApp.csproj" DefaultStartup="true" />From a directory containing exactly one .slnx file:
dotnet run-defaultOr pass the solution explicitly:
dotnet run-default .\MySolution.slnxAdditional arguments are forwarded to dotnet run:
dotnet run-default .\MySolution.slnx --configuration Release
dotnet run-default -- --my-app-optionPushing a tag in the form v<version> publishes that version to NuGet.org through
the Publish NuGet package GitHub Actions workflow. Before the first release,
configure NuGet Trusted Publishing for this repository and the GitHub release
environment as described in the workflow's comments.