Or-tools: Nuget package for Windows runtime is not compatible with dotnet core 3.1

Created on 23 Oct 2020  ·  6Comments  ·  Source: google/or-tools

Version: 8.0.8283
Language: C#

I am working on a multi-platform project (it's built and used on macOS/Linux/Windows) in dotnet core 3.1 using the OrTools via nuget. Until the last update, everything was ok, the 8.0.8283, however, misbehaves on Windows and shows me the following warning when building the project:

warning` NU1701: Package 'Google.OrTools.runtime.win-x64 8.0.8283' 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 '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

I have to stay with the older version for this reason only.

Help Needed .NET Windows

All 6 comments

It is just a warning.
Laurent Perron | Operations Research | [email protected] | (33) 1 42 68 53
00

Le ven. 23 oct. 2020 à 14:36, Mateusz Ślażyński notifications@github.com
a écrit :

Version: 8.0.8283
Language: C#

I am working on a multi-platform project (it's built and used on
macOS/Linux/Windows) in dotnet core 3.1 using the OrTools via nuget. Until
the last update, everything was ok, the 8.0.8283, however, misbehaves on
Windows and shows me the following warning when building the project:

warning` NU1701: Package 'Google.OrTools.runtime.win-x64 8.0.8283' 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 '.NETCoreApp,Version=v3.1'. This package may not
be fully compatible with your project.

I have to stay with the older version for this reason only.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/2207, or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACUPL3KFRKNHJ7FAGX3B7J3SMF2DHANCNFSM4S4QA5GA
.

Roger that. I'll open a better issue with the exact problem happening only in the Windows environment.

The issue is on Windows we target net45 AND netstandard2.0. For some reason (need to retrieve the issue) Nuget/.Net Core Teams have decided to send a warning on Visual Studio for any project consuming this kind of project.

@Mizux thanks for the clarification 👍

@mslazynski the thread: https://github.com/dotnet/standard/issues/439#issuecomment-321608375
and the warning id NU1701: https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1701

<ItemGroup>
  <PackageReference Include="Google.OrTools" Version="8.0.8283" NoWarn="NU1701" />
</ItemGroup>

Open question: Why .Net CoreApp 3.1 fallback instead of directly consuming netstandard2.0 TFM ?

Thanks.
FYI: adding NoWarn to PackageReference wasn't enough in my case, the warning was still there. Probably because I was referencing the whole of Google.OrTools and the NU1701 applied only to its single reference (Windows runtime). I had to disable NU1701 globally for the project to get rid of the warning.

<PropertyGroup>
    <NoWarn>$(NoWarn);NU1701</NoWarn>
</PropertyGroup>
Was this page helpful?
0 / 5 - 0 ratings