Skip to content

Conversation

@phillijw
Copy link

@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
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
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.

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.

2 participants