You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove SDK polyfills and retarget to newer MSBuild to enable TaskEnvironment.Fallback #13695
The current polyfill-based approach for enabling multithreading support in SDK tasks is incorrect and leads to broken behavior in MT mode and in edge cases in multiprocess mode.
Problem
SDK framework tasks currently use polyfilled versions of TaskEnvironment and IMultithreadableTask.
These polyfill types are not the same as the real MSBuild types, so MSBuild does not recognize them
However, the multithreadable attribute is recognized, so tasks are treated as multithreadable.
As a result:
Tasks are allowed to run in MT mode without task host
But MSBuild cannot inject the correct TaskEnvironment
This leads to execution in the wrong environment.
And in multi-process mode tasks may fail if they would run in .NET task host
Proposed Fix
Remove the polyfill entirely
Bump the MSBuild version used to compile SDK tasks
Target a version that includes TaskEnvironment.Fallback
Scope from meeting - bump version of MSBuild and instead of polyfill use the real TaskEnvironment. We also need to bump Mark Paine to give him a heads up.
Sync discussion: the PR for this is open. A few open questions to resolve before merge:
SDK ↔ MSBuild compliance bump. The SDK ships a data file used by the SDK resolver to enforce a minimum MSBuild version. Bumping this in lockstep with the binary update would force users of the .NET 11 SDK inside Visual Studio onto VS 18.6+. The MSBuild binaries used by the SDK will need to be bumped before .NET 11 GA regardless, so this is a question of timing; we may want to update the binaries now but defer the resolver-floor bump to broaden compatibility during the long-tail task migration.
Resolver vs. tasks decoupling. Today the same package version is consumed by both the resolver and the SDK tasks. Worth confirming whether we want to keep the resolver pinned to the older API while moving tasks to the new one, or bump everything together. The resolver shipped in VS still flows from the 10.x stable release branches, so a unified bump appears safe.
Version-override pattern. The PR currently uses per-project VersionOverride on PackageReference to work around binding-redirect issues. Preference is to update the package references centrally instead; the underlying binding-redirect concern should be addressed at its root.
Activity
jankratochvilcz commentedon May 6, 2026
Scope from meeting - bump version of MSBuild and instead of polyfill use the real TaskEnvironment. We also need to bump Mark Paine to give him a heads up.
Remove TaskEnvironment / IMultiThreadableTask polyfills (dotnet/msbui…
jankratochvilcz commentedon May 7, 2026
Sync discussion: the PR for this is open. A few open questions to resolve before merge:
VersionOverrideonPackageReferenceto work around binding-redirect issues. Preference is to update the package references centrally instead; the underlying binding-redirect concern should be addressed at its root.AR-May commentedon May 7, 2026
7.5.2026: need approval from sdk team to merge the PR.
Remove TaskEnvironment / IMultiThreadableTask polyfills (dotnet/msbui…
AR-May commentedon May 13, 2026
Done dotnet/sdk#54207