From 7e5f526c50525694ced0008696c77d0cd80b7c46 Mon Sep 17 00:00:00 2001 From: EduardF1 Date: Sat, 30 May 2026 01:21:10 +0200 Subject: [PATCH] fix(templates): conditionally omit package versions when CPM is active When a Directory.Packages.props file is detected (Central Package Management), template-generated .csproj files no longer emit Version attributes on PackageReference elements, preventing NETSDK1071 compile errors. Fixes #48903 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Commands/New/DotnetCommandCallbacks.cs | 1 + .../.template.config/template.json | 26 +++++++ .../MSTest-CSharp/Company.TestProject1.csproj | 13 ---- .../.template.config/template.json | 26 +++++++ .../MSTest-FSharp/Company.TestProject1.fsproj | 13 ---- .../.template.config/template.json | 26 +++++++ .../Company.TestProject1.vbproj | 13 ---- .../.template.config/template.json | 60 ++++++++++++++++ .../NUnit-CSharp/Company.TestProject1.csproj | 8 --- .../.template.config/template.json | 60 ++++++++++++++++ .../NUnit-FSharp/Company.TestProject1.fsproj | 7 -- .../.template.config/template.json | 60 ++++++++++++++++ .../Company.TestProject1.vbproj | 7 -- .../.template.config/template.json | 39 ++++++++++ .../Company.TestProject1.csproj | 14 ---- .../.template.config/template.json | 72 +++++++++++++++++++ .../Company.TestProject1.csproj | 9 --- .../.template.config/template.json | 48 +++++++++++++ .../XUnit-CSharp/Company.TestProject1.csproj | 7 -- .../.template.config/template.json | 48 +++++++++++++ .../XUnit-FSharp/Company.TestProject1.fsproj | 6 -- .../.template.config/template.json | 48 +++++++++++++ .../Company.TestProject1.vbproj | 6 -- 23 files changed, 514 insertions(+), 103 deletions(-) diff --git a/src/Cli/dotnet/Commands/New/DotnetCommandCallbacks.cs b/src/Cli/dotnet/Commands/New/DotnetCommandCallbacks.cs index 84c961b615cb..40618f64fa2e 100644 --- a/src/Cli/dotnet/Commands/New/DotnetCommandCallbacks.cs +++ b/src/Cli/dotnet/Commands/New/DotnetCommandCallbacks.cs @@ -19,6 +19,7 @@ internal static bool AddPackageReference(string projectPath, string packageName, IEnumerable commandArgs = ["add", projectPath, "package", packageName]; var packageAddCommandDef = new PackageAddCommandDefinition(); + commandArgs = commandArgs.Append(packageAddCommandDef.NoRestoreOption.Name); if (!string.IsNullOrWhiteSpace(version)) { commandArgs = commandArgs.Append(packageAddCommandDef.VersionOption.Name).Append(version); diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/.template.config/template.json index 4fa231e893c9..daa42f5ed73d 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/.template.config/template.json @@ -219,6 +219,32 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "condition": "(CoverageTool == \"coverlet\")", + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "condition": "(!UseMSTestSdk)", + "description": "Add the MSTest package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package MSTest --version 4.0.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "MSTest", + "version": "4.0.2" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj index 9fd33170462b..a9845e9e11c6 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj @@ -11,12 +11,6 @@ true - - - - - - $(ExtensionsProfile) @@ -39,13 +33,6 @@ - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/.template.config/template.json index 6acfb38af542..c205c763d35a 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/.template.config/template.json @@ -219,6 +219,32 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "condition": "(CoverageTool == \"coverlet\")", + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "condition": "(!UseMSTestSdk)", + "description": "Add the MSTest package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package MSTest --version 4.0.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "MSTest", + "version": "4.0.2" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj index c259c109e0c9..745923bbe3ca 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj @@ -11,12 +11,6 @@ true - - - - - - $(ExtensionsProfile) @@ -44,13 +38,6 @@ - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/.template.config/template.json index d73954f97e2a..d6e96c8e05c6 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/.template.config/template.json @@ -219,6 +219,32 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "condition": "(CoverageTool == \"coverlet\")", + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "condition": "(!UseMSTestSdk)", + "description": "Add the MSTest package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package MSTest --version 4.0.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "MSTest", + "version": "4.0.2" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj index 9fd33170462b..a9845e9e11c6 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj @@ -11,12 +11,6 @@ true - - - - - - $(ExtensionsProfile) @@ -39,13 +33,6 @@ - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/.template.config/template.json index 6a5c0eb76799..6458adcc27e2 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/.template.config/template.json @@ -78,6 +78,66 @@ } ], "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.0" + } + }, + { + "description": "Add the NUnit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit --version 4.3.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "NUnit", + "version": "4.3.2" + } + }, + { + "description": "Add the NUnit.Analyzers package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit.Analyzers --version 4.7.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "NUnit.Analyzers", + "version": "4.7.0" + } + }, + { + "description": "Add the NUnit3TestAdapter package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit3TestAdapter --version 5.0.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "NUnit3TestAdapter", + "version": "5.0.0" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/Company.TestProject1.csproj index e21c9b22a978..b2be80d1614e 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-CSharp/Company.TestProject1.csproj @@ -11,14 +11,6 @@ false - - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/.template.config/template.json index f9917f9be27a..84970243eb1c 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/.template.config/template.json @@ -74,6 +74,66 @@ } ], "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.0" + } + }, + { + "description": "Add the NUnit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit --version 4.3.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "NUnit", + "version": "4.3.2" + } + }, + { + "description": "Add the NUnit.Analyzers package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit.Analyzers --version 4.7.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "NUnit.Analyzers", + "version": "4.7.0" + } + }, + { + "description": "Add the NUnit3TestAdapter package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit3TestAdapter --version 5.0.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "NUnit3TestAdapter", + "version": "5.0.0" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/Company.TestProject1.fsproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/Company.TestProject1.fsproj index 323e235ae945..912754b346b8 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/Company.TestProject1.fsproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-FSharp/Company.TestProject1.fsproj @@ -15,12 +15,5 @@ - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/.template.config/template.json index 7854e54018f5..4912cb139ad1 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/.template.config/template.json @@ -74,6 +74,66 @@ } ], "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.0" + } + }, + { + "description": "Add the NUnit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit --version 4.3.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "NUnit", + "version": "4.3.2" + } + }, + { + "description": "Add the NUnit.Analyzers package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit.Analyzers --version 4.7.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "NUnit.Analyzers", + "version": "4.7.0" + } + }, + { + "description": "Add the NUnit3TestAdapter package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit3TestAdapter --version 5.0.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "NUnit3TestAdapter", + "version": "5.0.0" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/Company.TestProject1.vbproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/Company.TestProject1.vbproj index 3ac473bc2f43..66627f40511b 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/Company.TestProject1.vbproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/NUnit-VisualBasic/Company.TestProject1.vbproj @@ -9,12 +9,5 @@ false - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/.template.config/template.json index 339026195198..082005aac96c 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/.template.config/template.json @@ -239,6 +239,45 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "condition": "(CoverageTool == \"coverlet\")", + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "condition": "(!UseMSTestSdk)", + "description": "Add the Microsoft.Playwright.MSTest.v4 package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.Playwright.MSTest.v4 --version 1.55.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "Microsoft.Playwright.MSTest.v4", + "version": "1.55.0" + } + }, + { + "condition": "(!UseMSTestSdk)", + "description": "Add the MSTest package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package MSTest --version 4.0.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "MSTest", + "version": "4.0.2" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj index 6c02220c16fd..cedb6ca216a9 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj @@ -12,12 +12,6 @@ true - - - - - - $(ExtensionsProfile) @@ -40,14 +34,6 @@ - - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/.template.config/template.json index 38ddb706b7cb..57fa97b9da65 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/.template.config/template.json @@ -78,6 +78,78 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.0" + } + }, + { + "description": "Add the Microsoft.Playwright.NUnit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.Playwright.NUnit --version 1.52.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "Microsoft.Playwright.NUnit", + "version": "1.52.0" + } + }, + { + "description": "Add the NUnit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit --version 4.3.2 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "NUnit", + "version": "4.3.2" + } + }, + { + "description": "Add the NUnit.Analyzers package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit.Analyzers --version 4.7.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "NUnit.Analyzers", + "version": "4.7.0" + } + }, + { + "description": "Add the NUnit3TestAdapter package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package NUnit3TestAdapter --version 5.0.0 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "NUnit3TestAdapter", + "version": "5.0.0" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/Company.TestProject1.csproj index 12312d733513..0b35d5e373ba 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-NUnit-CSharp/Company.TestProject1.csproj @@ -11,15 +11,6 @@ false - - - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/.template.config/template.json index 899b4e539845..1cb04f93871a 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/.template.config/template.json @@ -70,6 +70,54 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.1 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.1" + } + }, + { + "description": "Add the xunit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package xunit --version 2.9.3 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "xunit", + "version": "2.9.3" + } + }, + { + "description": "Add the xunit.runner.visualstudio package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package xunit.runner.visualstudio --version 3.1.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.csproj" ], + "referenceType": "package", + "reference": "xunit.runner.visualstudio", + "version": "3.1.4" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/Company.TestProject1.csproj index 5fa6752c3c29..8cabb25310e6 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-CSharp/Company.TestProject1.csproj @@ -10,13 +10,6 @@ false - - - - - - - diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/.template.config/template.json index 9b508cdf6a9a..06a0725f6d50 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/.template.config/template.json @@ -66,6 +66,54 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.1 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.1" + } + }, + { + "description": "Add the xunit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package xunit --version 2.9.3 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "xunit", + "version": "2.9.3" + } + }, + { + "description": "Add the xunit.runner.visualstudio package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package xunit.runner.visualstudio --version 3.1.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.fsproj" ], + "referenceType": "package", + "reference": "xunit.runner.visualstudio", + "version": "3.1.4" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/Company.TestProject1.fsproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/Company.TestProject1.fsproj index 87dd7841f8bc..f6068546aedd 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/Company.TestProject1.fsproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-FSharp/Company.TestProject1.fsproj @@ -12,11 +12,5 @@ - - - - - - \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/.template.config/template.json index 9090fd8cb0f4..95a6aab0b7cd 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/.template.config/template.json @@ -66,6 +66,54 @@ ], "defaultName": "TestProject1", "postActions": [ + { + "description": "Add the coverlet.collector package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package coverlet.collector --version 6.0.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "coverlet.collector", + "version": "6.0.4" + } + }, + { + "description": "Add the Microsoft.NET.Test.Sdk package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.NET.Test.Sdk --version 17.14.1 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "Microsoft.NET.Test.Sdk", + "version": "17.14.1" + } + }, + { + "description": "Add the xunit package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package xunit --version 2.9.3 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "xunit", + "version": "2.9.3" + } + }, + { + "description": "Add the xunit.runner.visualstudio package reference.", + "manualInstructions": [{ "text": "Run 'dotnet add package xunit.runner.visualstudio --version 3.1.4 --no-restore'" }], + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "args": { + "files": [ "Company.TestProject1.vbproj" ], + "referenceType": "package", + "reference": "xunit.runner.visualstudio", + "version": "3.1.4" + } + }, { "condition": "(!skipRestore)", "description": "Restore NuGet packages required by this project.", diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/Company.TestProject1.vbproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/Company.TestProject1.vbproj index f34b4aba4a86..64b9a26392af 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/Company.TestProject1.vbproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/XUnit-VisualBasic/Company.TestProject1.vbproj @@ -8,11 +8,5 @@ false - - - - - - \ No newline at end of file