dotnet-svcutil: support WCF 10.* and make TFM->package mapping forward-compatible#5954
Open
imcarolwang wants to merge 1 commit into
Open
dotnet-svcutil: support WCF 10.* and make TFM->package mapping forward-compatible#5954imcarolwang wants to merge 1 commit into
imcarolwang wants to merge 1 commit into
Conversation
…d-compatible
GetWcfProjectReferences picked a fixed-list `Current` bucket (8.*) for any TFM in {8.0, 9.0, 10.0} and fell through to the Legacy 4.10.* bucket for anything else. This meant: (a) projects targeting net10.0 still got WCF 8.* (netstandard2.0 fallback asset instead of the native net10.0 asset), and (b) once the arcade SDK bumps to net11.0+, every baseline test would silently switch to the 5-package Legacy set.
Changes in TargetFrameworkHelper.cs:
- Add a `Net10` bucket pinned to WCF 10.* (Http/NetTcp/Primitives).
- Rename `Current` -> `Net8` for clarity (unchanged content, 8.*).
- Replace the closed-list `s_currentSupportedVersions.Contains(...)` selection with a >= threshold: net10.0+ -> Net10, net8.0/net9.0 -> Net8, otherwise Legacy. Future .NET versions automatically pick the highest available bucket.
- Remove the now-unused `s_currentSupportedVersions` list. Both remaining callers (IsEndofLifeFramework, MSBuildProj.ParseAsync default-TFM fallback) only used `.First()`, so replace with a single `MinSupportedDotNetVersion` const (`8.0`).
MSBuildProj.cs: update the fallback to use the new constant.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
42835bd to
9fc56d4
Compare
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.
Problem
TargetFrameworkHelper.GetWcfProjectReferences(used bydotnet-svcutilto add<PackageReference>entries to a user project after generating WCF proxy code) had two issues:No WCF 10.* support. The "Current" bucket pinned WCF packages to
8.*for every TFM ins_currentSupportedVersions = { "8.0", "9.0", "10.0" }, so a project targetingnet10.0still got the8.*packages.Forward-compatibility regression waiting to happen. Selection used a closed-list
Contains(...)check. As soon as the SDK bumps tonet11.0+, the lookup misses → the tool silently falls through to the Legacy4.10.*bucket (5 packages instead of 3), which would mass-break test baselines (FixupUtil.csnormalizes package versions but not the number/set of packages).Changes
src/dotnet-svcutil/lib/src/Shared/TargetFrameworkHelper.csAdd a
Net10bucket pinned to WCF10.*(System.ServiceModel.Http,NetTcp,Primitives).Rename the existing
Currentbucket →Net8for clarity (same 3 packages at8.*).Replace the closed-list membership check with a
>=threshold so future .NET versions automatically pick the highest available bucket:>= net10.0(incl. future net11+)10.*net8.0/net9.08.*4.10.*net462only)System.ServiceModelassembly referenceRemove the now-unused
s_currentSupportedVersionslist. Both remaining callers (IsEndofLifeFramework,MSBuildProj.ParseAsyncdefault-TFM fallback) only used.First(), so it collapses to a singleinternal const string MinSupportedDotNetVersion = "8.0".src/dotnet-svcutil/lib/src/Shared/MSBuildProj.csMinSupportedDotNetVersion.Behavior preservation
net8.0,net9.0,net10.0projects all still emit the same 3-package set, so existing baselines remain valid (FixupUtil.cs:51normalizes versions per-line).netstandard2.0-only,net6.0,net48,net462;netstandard2.0continue to hit the Legacy bucket as before.net462-only continues to receive the full-frameworkSystem.ServiceModelassembly reference (early return path, untouched).IsEndofLifeFrameworksemantics unchanged (boundary is still8.0).Forward-compat win
When arcade bumps the SDK to
net11.0+, the new logic picks theNet10bucket (3 packages) instead of dropping into the Legacy 5-package set — no baseline churn required at that point.