Skip to content

Commit

Permalink
chore: fix dotnet -p deprecation warning (#18632)
Browse files Browse the repository at this point in the history
# Overview
Replace usage of `-p` with `--project` for `dotnet run` to resolve deprecation warning (`NETSDK1174`).

This appears during AWS CDK usage under .NET (C#, F#).

The full error message is similar to the following example:

> The abbreviation of -p for --project is deprecated. Please use --project.

> The use of -p in dotnet run is deprecated because of the close relationship dotnet run has with dotnet build and dotnet publish. In dotnet build and dotnet publish, p is used to set MSBuild properties. This deprecation is the first step in aligning abbreviations for these three commands.

Resolves #18092

# References
See https://docs.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1174

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Plasma authored Jan 26, 2022
1 parent 97a9b51 commit 031c742
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
"watch": {
"include": ["**"],
"exclude": [
Expand Down

0 comments on commit 031c742

Please sign in to comment.