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
[MSBuildReferences.projitems] Require opt-in to use Microsoft.Build (#220)
Projects that import `MSBuildReferences.projitems` receive a
`@(PackageReference)` to the `Microsoft.Build` NuGet package.
However, many consumers have `$(TargetFramework)`=netstandard2.0, and
the `Microsoft.Build` package does not have support netstandard2.0,
resulting in the following warnings:
Warning NU1701 Package 'Microsoft.Build 17.3.2' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Warning NU1701 Package 'Microsoft.IO.Redist 6.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Most consumers do not actually need this package, so we can make it
opt-in to prevent the warnings and extra dependencies in those
projects. Packages opt-in to referencing the `Microsoft.Build`
package by setting the `$(_IncludeMicrosoftBuildPackage)` MSBuild
property to true:
<_IncludeMicrosoftBuildPackage>true</_IncludeMicrosoftBuildPackage>
Note: this will be a "breaking" change to an unknown amount of consumers.
We're crossing our fingers that this won't break too much.
Enabling this change fixes 226 CI warnings in xamarin-android.
0 commit comments