A csproj is referencing fo-dicom
nuget package, where fo-dicom
depends on fo-dicom.Desktop
package (targeting netFrameowork45).
Preforming nuget restore
for the project generates a warning
NU1701: Package 'fo-dicom.Desktop 4.0.8.1' 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' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project
The nuspec for fo-dicom already identifies the target framework for the dependency.
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>fo-dicom</id>
<version>4.0.8.1</version>
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="fo-dicom.Desktop" version="4.0.8.1" />
</group>
</dependencies>
</metadata>
</package>
The warning is only generated if nuget restore is performed using msbuild. Nuget restore from VS runs just fine. This warning in turn causes the msbuild to fail. I tried suppressing the warning but since the nuget dependency is not correctly loaded, the build fails anyway.
Why does it just occur with msbuild and not VS, and if there is a solution not to make it happen?