MongoDB C# driver 2.13.1 indirect dependency on System.ValueTuple 4.0.3.0 breaks build for .Net framework 4.8

I am upgrading from Mongo C# driver version 2.6 to the latest 2.13.1 with target framework as .net framework 4.8. I have tried to explicitly add a reference to the required version of the System value tuple(4.0.3) in the project and/or add binding redirects but some error. I am getting the below error after the upgrade, has anyone come across this? If so how to resolve it?

[msbuild] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference “MongoDB.Driver” could not be resolved because it has an indirect dependency on the .NET Framework assembly “System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51” which has a higher version “4.0.3.0” than the version “4.0.2.0” in the current target framework. [C:\CODE***\MongoDB.csproj] [msbuild] MongoDBConnection.cs(4,15): error CS0234: The type or namespace name ‘Driver’ does not exist in the namespace ‘MongoDB’ (are you missing an assembly reference?)

Thank you for your question @Akshay_Kulkarni.

We were unable to reproduce this via basic .net 4.8 console app.
Could you please provide a self-contained code that reproduces this behavior?

Thanks.

1 Like