-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecating -p
for --project
for dotnet run
#24727
Labels
breaking-change
Indicates a .NET Core breaking change
🏁 Release: .NET 6
Issues and PRs for the .NET 6 release
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
Comments
gewarren
added
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
breaking-change
Indicates a .NET Core breaking change
and removed
Pri3
labels
Jun 17, 2021
I respect the desire for aligning the options of build, run, and publish. But as someone who types |
Is it possible to deprecate |
adegeo
added
rerun-action-opened
and removed
breaking-change
Indicates a .NET Core breaking change
labels
Jun 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking-change
Indicates a .NET Core breaking change
🏁 Release: .NET 6
Issues and PRs for the .NET 6 release
doc-idea
Indicates issues that are suggestions for new topics [org][type][category]
Pri1
High priority, do before Pri2 and Pri3
This change is documented in Spec for resolving '-p' in 'dotnet run'
Deprecate -p
-p
will no longer be a valid abbreviation forproject
. In .NET 6, users will receive a warning.This warning will be from the CLI parser, so will not generally trigger WarningsAsErrors failures. However, if a wrapping MSBuild or CI process checks for the text "Warning" it will appear in that check.
Also, if
--property
is an option passed to the application being run, the--
syntax separator must be used.Version introduced
.NET Core 6.0 Preview 6
Old behavior
-p
previously indicated--project
.--property
was not a valid option ondotnet run
and was passed through to the underlying application, even if the--
syntax separator was not used.New behavior
-p
will retain this meaning for .NET 6, but will result in a warning that it is deprecated and to use the full--project
. At some future point, we will remove the use of-p
to indicate--project
.--property
is now a valid option ondotnet run
and this option will not be passed through to the underlying application, unless the--
syntax separator is used.Reason for change
We are deprecating
-p
because of the close relationshipdotnet run
has withdotnet build
anddotnet publish
. This breaking change is the first step in aligning abbreviations for these commands.Embracing Xamarin/Maui results in a need to pass MSBuild properties to MSBuild during the build portion of
dotnet run
. We want the option specifying this to be the same fordotnet run
,dotnet build
anddotnet publish
.Recommended action
If you encounter the new warning, please use
--project
. If you have a project argument that includes an=
and use the-p
abbreviation, it will be interpreted as--property
and passed to MSBuild, so you will have to use--project
to pass it to your application in all cases.If you have an application that has an option called
--property
, you will need to use the syntax separator to pass the the value to your application:Please review any scripts that use
dotnet run
where you might overlook the warning if-p
is used.If you have any scripts that are using “dotnet run” and process the output you could encounter a break.
dotnet run
typically doesn’t output anything of its own if there are no errors, so you only get the output of the program that is being run. If you have a script or other program wrapping “dotnet run” and parsing the output, the warning would be unexpected text and may cause a failure.Category
Affected APIs
Not detectable via API analysis
Issue metadata
The text was updated successfully, but these errors were encountered: