[CSHARP-2592] Add .NET Standard 2.0 support Created: 17/Apr/19 Updated: 28/Oct/23 Resolved: 28/Jan/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Build |
| Affects Version/s: | 2.11.0 |
| Fix Version/s: | 2.11.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Vincent Kam (Inactive) | Assignee: | Dmitry Lukyanov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
Per Microsoft's guidance for open source libraries (https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting), we should consider adding support for .NET Standard 2.0. We should be able to accomplish this while still maintaining support for .NET Standard 1.5 until we decide when we want to drop support for .NET Standard 1.5. For testing, we could ensure that the our test projects test both libraries by having the test projects target .NET Core 1.0 and 2.x, with the former consuming the .NET Standard 1.5 driver and the latter consuming the .NET Standard 2.x driver |
| Comments |
| Comment by Githook User [ 28/Jan/20 ] |
|
Author: {'email': 'dmitry.lukyanov@mongodb.com', 'username': 'DmitryLukyanov', 'name': 'DmitryLukyanov'}Message: |
| Comment by Yuheng Xiang [ 13/Jan/20 ] |
|
You will think it a true statement if you look deep into it. .NET Standard actually have various meanings during the discussion. It's original definition is a set of APIs, which is not likely to be deprecated as you explained, but what we are actually dealing with is a target that the program in built against, which is about the packages versioning and shipping. As linked above multi-targeting, it's true that .NET Standard 1.x is marked to be avoided. .NET Standard 1.x is distributed as a granular set of NuGet packages, which creates a large package dependency graph and results in developers downloading a lot of packages when building. Modern .NET platforms, including .NET Framework 4.6.1, UWP and Xamarin, all support .NET Standard 2.0. You should only target .NET Standard 1.x if you specifically need to target an older platform. It is not only a problem about pattern or styling. It causes problems. |
| Comment by Robert Stam [ 13/Jan/20 ] |
|
I don't think that is a true statement. Since .NET Standard versions are just different sets of APIs, I don't think any version of .NET Standard is ever deprecated. Only the frameworks that implement .NET Standard versions get deprecated. You can use the .NET Driver with any current version of either .NET Core or .NET Framework. We definitely intend to target .NET Standard 2.0 at some point, but I don't think it is as urgent as you say. |
| Comment by Yuheng Xiang [ 13/Jan/20 ] |
|
This should be considered prior to everything else. Targeting a deprecated framework also makes the whole driver deprecated. In other words, MONGODB HAS CURRENTLY NO QUALIFIED SUPPORT FOR .NET |
| Comment by Jimmy Bogard [ 13/Aug/19 ] |
|
I opened a PR for `netstandard2.0` support: |
| Comment by Jimmy Bogard [ 13/Aug/19 ] |
|
Do you need any help on this one? I've converted all my OSS projects to add `netstandard2.0` support, it hasn't been too bad doing so. I'd be happy to open a PR for it.
Selfishly it would allow us to target `netstandard2.0` instead of `netcoreapp2.2` in some of our shared libraries that reference this package. |
| Comment by Robert Stam [ 30/Apr/19 ] |
|
Even if we use nothing new from .NET Standard 2.0 there are benefits to targetting netstandard2.0 as well as netstandard1.5. See "DO include a netstandard2.0 target if you require a netstandard1.x target." here On the other hand, that article also says: "You should only target .NET Standard 1.x if you specifically need to target an older platform." |