Skip to content

Fixes .net10 msbuild compatibility issue (#1716)#1738

Merged
josefpihrt merged 3 commits intodotnet:mainfrom
phillijw:fix-1716
Feb 7, 2026
Merged

Fixes .net10 msbuild compatibility issue (#1716)#1738
josefpihrt merged 3 commits intodotnet:mainfrom
phillijw:fix-1716

Conversation

@phillijw
Copy link
Contributor

@phillijw phillijw commented Jan 7, 2026

The msbuild version in .net10 has breaking changes from previous versions. This conditionally selects the appropriate version depending on the target framework during build.

@phillijw
Copy link
Contributor Author

phillijw commented Jan 7, 2026

I'm unsure if setting NoWarn="NU1701" for this error is the correct choice or if there is a better solution.

Edit: Perhaps changing the condition for .net8 and 9 to != 'net10.0' would be preferable

@josefpihrt
Copy link
Collaborator

Version 17.14.28 should support .NET 10 https://www.nuget.org/packages/Microsoft.Build/17.14.28#supportedframeworks-body-tab

I guess this should work:

<PackageReference Include="Microsoft.Build" Version="17.14.28" ExcludeAssets="runtime" Condition="'$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="Microsoft.Build" Version="18.0.2" ExcludeAssets="runtime" Condition="'$(TargetFramework)' == 'net10.0'" />

@phillijw Could you please elaborate why do you think it will fix the issues if the lower version supports .NET 10?

@phillijw
Copy link
Contributor Author

phillijw commented Jan 7, 2026

@phillijw Could you please elaborate why do you think it will fix the issues if the lower version supports .NET 10?

I think the change you suggested is the correct fix after doing some more digging. I will push that change to see.

@holger-at-schottel-de
Copy link

Can someone review this pull request please.

CLI still does not work in dotnet 10 SDK containers.

@josefpihrt josefpihrt merged commit 0992679 into dotnet:main Feb 7, 2026
17 checks passed
@holger-at-schottel-de
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants