I've got an idea of a C# class library I would like to develop and release to open-source. I would like to make it easily available (with recompilation if necessary) on as many of the available .Net platforms as possible (e.g. full .Net, Mono, .Net Core, Xamarin, only the classic .Net compatibility is a real must, however). The library is not going to depend on anything UI-related nor Windows-only stuff like WPF.
All I need are:
- the common .Net types and APIs (I don't want to get surprised by absence of something I consider an essential part of the language)
- JSON and XML manipulation facilities
- file system access (somewhat restricted perhaps),
- HTTPS client,
- SQL-level RDBMS client (I don't need ORM functionality though of course don't mind it being available)
- Reflection if possible
- Async and threading facilities if possible
- The latest version of the C# language possible
I am choosing between the following project types
- Class Library (.NET Core)
- Class Library (.NET Standard)
- Class Library (.NET Framework)
- Class Library (Portable)
I have heard that Portable is what it says but now we've got Core that runs on Linux and Mac (Windows Phone and Xamarin too perhaps?) and I have almost no problems using EF Core that obviously targets it in my classic Windows Desktop .NET Framework apps. Classic .NET Framework code seems to be quite well supported on non-Windows platforms thanks to Mono and Xamarin. .NET Standard - I have no clue what does this mean, I've just discovered this type with the "New Project" window search tool by looking for all the varieties of "Class Library".
Which one should I choose, why, and what should I know about it?
You can easily run a few experiments to assert the statements I made above.
As a library publisher myself, I choose to ship NuGet packages containing .NET Framework version, .NET Standard version, and PCL version at this moment, and would gradually drop .NET Framework and PCL versions in the long run. Many other libraries do the same.
I also wrote a blog post to cover more,
https://blog.lextudio.com/which-class-library-project-to-go-in-visual-studio-2015-2017-a48710cf3dff