Skip to content

Commit 031c742

Browse files
authored
chore: fix dotnet -p deprecation warning (#18632)
# 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*
1 parent 97a9b51 commit 031c742

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

packages/aws-cdk/lib/init-templates/v1/app/csharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v1/app/fsharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v1/sample-app/csharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v1/sample-app/fsharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v2/app/csharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v2/app/fsharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v2/sample-app/csharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.csproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.csproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

packages/aws-cdk/lib/init-templates/v2/sample-app/fsharp/cdk.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "dotnet run -p src/%name.PascalCased%/%name.PascalCased%.fsproj",
2+
"app": "dotnet run --project src/%name.PascalCased%/%name.PascalCased%.fsproj",
33
"watch": {
44
"include": ["**"],
55
"exclude": [

0 commit comments

Comments
 (0)