Commit 4889bf0
authored
[MSBuildReferences.projitems] Require opt-in to use
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.Microsoft.Build (#220)1 parent 21de3d7 commit 4889bf0
File tree
1 file changed
+1
-1
lines changed- src/Microsoft.Android.Build.BaseTasks
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments