7

I ran the .NET Portability Analyzer against a class library that I want to use from my own .NET Standard class library. The class I want to use has a dependency on .NET framework. The compatibility results were 91% for .NET Standard and 100% for .NET Standard + Platform Extensions.

From what I've read I understand that Platform Extensions means that there are some nuget packages that if I add to my project I'll get the 100% compatibility.

The question is how do I know what nuget packages should I install? All I could find was this page that just lists a bunch of namespaces - how to determine which of them do I need for my project?

.NET Portability Analyzer Results

BornToCode
  • 9,495
  • 9
  • 66
  • 83
  • 1
    It is in effect telling you that your app isn't portable and *might* be portable if you can find substitutes. If you only plan to target the Windows platform, probably necessary, then just add a reference to the Windows Compatibility Pack: https://www.nuget.org/packages/Microsoft.Windows.Compatibility/2.1.1 Guessing a bit at the best version btw. – Hans Passant May 29 '19 at 09:12
  • 1
    look under "Details" tab to see more. – magicandre1981 May 29 '19 at 14:31
  • @magicandre1981 Thank you, so I guess this is the answer.. I have to look in the details tab, then copy the type name and paste it into the Browse tab in the Manage Nuget Packages for solution and then I guess I'm covered. – BornToCode May 29 '19 at 16:21
  • 1
    I'm not sure it's that simple (I wish it was). I did exactly this and added [System.Drawing.Common](https://www.nuget.org/packages/System.Drawing.Common/). My assembly built for Net Standard, but can fail at runtime on Linux with a `PlatformNotSupportedException`. – Rob Sep 11 '19 at 20:49

0 Answers0