dotnet / pinvoke

A library containing all P/Invoke code so you don't have to import it every time. Maintained and updated to support the latest Windows OS.
MIT License
2.12k stars 222 forks source link

Drop targeting all but netstandard2.0, uap10.0, and net45 #435

Closed AArnott closed 4 years ago

AArnott commented 5 years ago

Microsoft's long-term support for .NET Core 1.x and 2.0 are over. Customers targeting these versions are in a really bad place due to no security patches being offered and thus there are likely few to none out there.

Similarly, such a critical mass of customers already have net472 on their machines that many apps and libraries now support it.

PCLs (e.g. portable-net40+win8+wpa81) have not been createable in VS for years as well.

This means we can likely target just netstandard2.0 (and UWP to retain our Store app compliance).

AArnott commented 5 years ago

@vbfox @arlm @jmelosegui Comments or concerns?

arlm commented 5 years ago

Makes complete sense for me.

Andrew Arnott notifications@github.com schrieb am So., 7. Juli 2019, 14:25:

@vbfox https://github.com/vbfox @arlm https://github.com/arlm @jmelosegui https://github.com/jmelosegui Comments or concerns?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AArnott/pinvoke/issues/435?email_source=notifications&email_token=AACPZL63HWSIACZZYKAVM5TP6HOEXA5CNFSM4H6VSAXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLKQ7Y#issuecomment-508995711, or mute the thread https://github.com/notifications/unsubscribe-auth/AACPZL5OXOXL4VISGNWPXT3P6HOEXANCNFSM4H6VSAXA .

vatsan-madhavan commented 4 years ago

I had a hard time building the repo recentlly - had to download an archived copy of Win8 SDK to get a clean build. I may have had to install some netfx dev pack as well.. glad this is being considered.

AArnott commented 4 years ago

In 9bf33aeecb9 I dropped the PCL profiles from all projects. I dropped net40 from all but one project (only one project actually needed it). I also dropped win8 support because VS2019 has a bug(?) where it can't build them even with the Win8 SDK installed. In place of win8 I target uap10.0.

The CONTRIBUTING.md doc is updated with instructions to get it to build. I've tested it on a very clean Win10 machine (using Win10's Sandbox VM) so I believe it should all work.

I haven't yet dropped net20 support. I might do that. I'll wait to hear if there are screams from just dropping net40 or PCLs or Win8 before cutting more.

qmfrederik commented 4 years ago

re: net20: I couldn't find any hard numbers, but it looks like Windows 7 is the oldest Windows version which is still relevant. .NET 4.x should be delivered to that OS via Windows Update. So I'd say it's safe to assume NET 4.x is a good baseline.

AArnott commented 4 years ago

Yes, for all except embedded medical devices which tend to be many years behind everyone else. But then, they probably won't be consuming these nuget packages directly anyway, and they can always copy and paste the code they need. So ya, let's do it.

vatsan-madhavan commented 4 years ago

OTOH now there are netfx ref assemblies available on NuGet that seem to work reliably. Not discouraging this move - just pointing out an option.

https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies.net20/

AArnott commented 4 years ago

@vatsan-madhavan We already use these:

https://github.com/dotnet/pinvoke/blob/4a256494e38e8fff02113dbc4d9bd2f3b78435d1/src/Directory.Build.props#L82

But I'm not sure what that has to do with the discussion. We're not dropping net20 support for lack of ref assemblies. The build is quite slow, and the design-time experience in VS is rather sluggish and memory heavy as well. Reducing the TFMs we support make development that much better.

While dropping netstandard1.x support seems to make sense, dropping net20 is probably a little more debatable. Still, I'm open to all arguments for and against.

AArnott commented 4 years ago

We're keeping net45 for now. netstandard2.0 and uap10.0 are also still around per proposal. The rest are gone.