[CSHARP-3875] Run netstandard21 targets on .NET Core 3.1 Created: 22/Sep/21  Updated: 28/Oct/23  Resolved: 23/Sep/21

Status: Closed
Project: C# Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: 2.14.0

Type: Improvement Priority: Unknown
Reporter: James Kovacs Assignee: James Kovacs
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Right now we have a lot of warnings in our builds about netcoreapp3.0 being out of support:

[2021/09/22 22:36:58.750] C:\data\mci\9456f863c4c1c35df15dfbf172938846\mongo-csharp-driver\.dotnet\sdk\5.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp3.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\data\mci\9456f863c4c1c35df15dfbf172938846\mongo-csharp-driver\tests\MongoDB.Bson.Tests\MongoDB.Bson.Tests.csproj]

Since our build scripts only install .NET Core 2.1 and 3.1, our netstandard21 targets are being run on .NET Core 3.1 anyways. The build tooling tries to run it on .NET Core 3.0 (aka netcoreapp3.0), can't find it, and silently upgrades to run on the next available version which is netcoreapp3.1.

The netstandard20 TFM is already targeting .NET Core 2.1 (aka netcoreapp2.1) for testing.

We should modify build.cake to use .NET Core 3.1 (aka netcoreapp3.1) for running our netstandard21 targets. This should remove the out of support build warnings while our actual testing behaviour remains unchanged because the .NET SDK has been silently upgrading those tests to run on .NET Core 3.1 anyways.



 Comments   
Comment by Githook User [ 23/Sep/21 ]

Author:

{'name': 'James Kovacs', 'email': 'jkovacs@post.harvard.edu', 'username': 'JamesKovacs'}

Message: CSHARP-3875: Update netstandard2.1 to run on netcoreapp3.1 to remove netcoreapp3.0 out of support warnings. (#627)
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/da337c58f1f200c906e4a2c614131ebb1e64958f

Generated at Wed Feb 07 21:46:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.