Using MongoDB.Bson 3.0.0 with .NET Framework 8

MongoDB.Bson 3.0.0 requires .NET standard 2.1 but .NET framework does not support .NET standard.dll 2.1. Yet Nuget allows upgrading to MongoDB.Bson 3.0.0 for .NET Framework 8 projects.

Hi, Markus,

MongoDB .NET/C# Driver 3.0.0 supports net472 (AKA full framework), netstandard2.1 (AKA .NET Core 3.X), and net6 (AKA .NET 6+). If you are compiling for .NET 8, it will use the net6 assemblies. If you are compiling for .NET Framework, it will use the net472 assemblies. If you are compiling for .NET Core 3.X or .NET 5, then the netstandard2.1 assemblies will be used.

In summary, the 3.0.0 driver is compatible with .NET 8 and your C# compiler and toolchain will use the correct assemblies contained in our NuGet packages to target the desired framework.

Please let us know if you have any additional questions or concerns.

Sincerely,
James

1 Like

I am able to use 3.0.0 with .NET Framework 8 successfully. But when we deployed and tested it didn’t log any records in mongo db. Then reverted back to 2.19.0

@James_Kovacs, are there any plans to support .netstandard2.0?

Parts of our application are net472 and others are net8, so we have a shared class library that targets netstandard2.0 containing all of our mongodb code (so that it can be used by net472 and net8). This worked well for us up until the 3.0.0 update (which no longer supports this scenario)

Any information would be greatly appreciated, thanks.