How do I know which Platform Extensions do I need for .NET Standard?
Asked Answered
J

0

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

Jana answered 29/5, 2019 at 7:9 Comment(4)
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: nuget.org/packages/Microsoft.Windows.Compatibility/2.1.1 Guessing a bit at the best version btw.Municipalize
look under "Details" tab to see more.Pinkerton
@Pinkerton 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.Jana
I'm not sure it's that simple (I wish it was). I did exactly this and added System.Drawing.Common. My assembly built for Net Standard, but can fail at runtime on Linux with a PlatformNotSupportedException.Phaedra

© 2022 - 2024 — McMap. All rights reserved.