Drop netstandard2.0 support from template engine#54041
Merged
MichaelSimons merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
NuGet dropped netstandard support in 7.0, and Microsoft.TemplateEngine.Edge depends on NuGet packages (NuGet.Configuration, NuGet.Credentials, NuGet.Protocol). This makes it difficult to continue supporting netstandard2.0 in the template engine going forward. This is a breaking change for .NET 11, agreed upon with @ChetHusk. Changes: - Remove netstandard2.0 from TargetFrameworks in all 8 template engine projects - Remove NuGet VersionOverride pins in Edge.csproj (were pinning to an older netstandard-compatible NuGet version via NugetNetStandardCompatibleVersion) - Remove NugetNetStandardCompatibleVersion property from eng/Versions.props - Remove CentralPackageTransitivePinningEnabled=false workaround from src/TemplateEngine/Directory.Build.props (was needed to keep transitive NuGet deps on the older pinned version) - Update IsExternalInit.cs polyfill guard from NETSTANDARD || NETFRAMEWORK to just NETFRAMEWORK Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes netstandard2.0 targeting from the TemplateEngine projects in the SDK repo, eliminating the need for older NuGet package pinning/workarounds and aligning TemplateEngine’s supported TFMs with the repo’s current NuGet package versions (breaking change intended for .NET 11).
Changes:
- Drop
netstandard2.0fromTargetFrameworksacross 8 TemplateEngine projects. - Remove now-unnecessary NuGet package
VersionOverridepinning inMicrosoft.TemplateEngine.Edge. - Remove the related infrastructure/workarounds (
NugetNetStandardCompatibleVersionproperty and TemplateEngine transitive pinning opt-out), and simplify theIsExternalInitpolyfill guard.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/TemplateEngine/Tools/Microsoft.TemplateEngine.TemplateLocalizer.Core/Microsoft.TemplateEngine.TemplateLocalizer.Core.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Shared/IsExternalInit.cs | Restricts polyfill to NETFRAMEWORK only (since NETSTANDARD is no longer targeted). |
| src/TemplateEngine/Microsoft.TemplateEngine.Utils/Microsoft.TemplateEngine.Utils.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Microsoft.TemplateEngine.IDE/Microsoft.TemplateEngine.IDE.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Microsoft.TemplateEngine.Edge/Microsoft.TemplateEngine.Edge.csproj | Removes netstandard2.0 target and drops NuGet package VersionOverride pinning. |
| src/TemplateEngine/Microsoft.TemplateEngine.Core/Microsoft.TemplateEngine.Core.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Microsoft.TemplateEngine.Core.Contracts/Microsoft.TemplateEngine.Core.Contracts.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Microsoft.TemplateEngine.Abstractions/Microsoft.TemplateEngine.Abstractions.csproj | Removes netstandard2.0 from multi-targeting list. |
| src/TemplateEngine/Directory.Build.props | Removes CentralPackageTransitivePinningEnabled=false workaround previously needed for netstandard/NuGet pinning. |
| eng/Versions.props | Removes NugetNetStandardCompatibleVersion property (no longer referenced). |
mthalman
approved these changes
Apr 22, 2026
Contributor
|
Added When you commit this breaking change:
You can refer to the .NET SDK breaking change guidelines |
NikolaMilosavljevic
approved these changes
Apr 22, 2026
Member
Author
|
/ba-g known intermittent crash in net analyzer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drop
netstandard2.0from all template engine projectTargetFrameworks. This is a breaking change for .NET 11.Motivation
NuGet dropped netstandard support starting with version 7.0.
Microsoft.TemplateEngine.Edgedepends on NuGet packages (NuGet.Configuration,NuGet.Credentials,NuGet.Protocol), which made it increasingly difficult to maintain netstandard2.0 compatibility — the project had to pin these packages to older versions viaVersionOverrideusingNugetNetStandardCompatibleVersion, and disableCentralPackageTransitivePinningEnabledto prevent transitive deps from being pulled up to the repo-wide 7.x versions.After discussion with @baronfel, we agreed to make this breaking change in .NET 11.
Changes
netstandard2.0fromTargetFrameworks(Abstractions, Core, Core.Contracts, Edge, IDE, Orchestrator.RunnableProjects, Utils, TemplateLocalizer.Core)VersionOverride="$(NugetNetStandardCompatibleVersion)"from NuGet package references and associated commentNugetNetStandardCompatibleVersionproperty (no longer needed)CentralPackageTransitivePinningEnabled=falseworkaround and associated comment#if NETSTANDARD || NETFRAMEWORKto#if NETFRAMEWORKRemaining targets
All 8 projects now target:
$(NetMinimum),$(NetCurrent),$(NetFrameworkToolCurrent)