Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi;

I am using the latest nuget 3.3.9 referenced in my .net standard 2.0 library

When I build my library in VS I get this warning:

Severity    Code    Description    Project    File    Line    Suppression State    Details
Warning    NU1701    Package 'FSUIPCClientDLL 3.3.9' 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.    FlightSimLibrary    F:\DEV\Current\Libraries\FlightSimLibrary\FlightSimLibrary.csproj    1        

Although when I run any application on .net 8 that uses this library everything works fine this warning pollutes my build and would like it to be gone.

What's the reason for this warning?


 

Posted

Hi,

You are getting the warnings because my DLL depends on the Win32 API and the WinForms library . Those are not included in the .NET Standard 2.0 specification. 

It's telling you that if you use my library, your application will no longer be .NET Standard 2.0 compatible. e.g. It won't run on Linux. 

Running it on a Windows .NET 8 machine will be fine because that platform does include the Win32 API and the WinForms library.

Since my DLL cannot work on any platform except Windows I cannot make it target a cross-platform specification like .NET Standard 2.0. Even the .NET versions I do target have to be the specific 'windows' versions. e.g. net6.0-windows not net6.0.

If you must use Standard 2.0, the only thing you can do is tell VS to suppress the warning, but your app will not really be compatible with Standard 2.0.

Paul

Posted

Ah, Okay, thanks for the explanation. No worries. I don't have any plans to run it on different platform other than Windows.

The important thing is to know the source of the warning (ie. why). I'll leave the warning as is for now.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.