-
Type: Bug
-
Resolution: Gone away
-
Priority: Critical - P2
-
None
-
Affects Version/s: 2.22.0
-
Component/s: None
Summary
I get System.MissingMethodException when trying to connect to MongoDB instance.
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
Driver version 2.22.0
How to Reproduce
Run following code in .NET 7 on linux-x64
var client = new MongoClient("mongodb://my-mongodb-server:27017/"); var databases = client.ListDatabases().ToList();
publish using following publish profile:
<?xml version="1.0" encoding="utf-8"?> <Project> <PropertyGroup> <Configuration>Release</Configuration> <PublishDir>bin\publish\linux-x64\</PublishDir> <PublishProtocol>FileSystem</PublishProtocol> <_TargetId>Folder</_TargetId> <TargetFramework>net7.0</TargetFramework> <RuntimeIdentifier>linux-x64</RuntimeIdentifier> <SelfContained>true</SelfContained> <PublishSingleFile>true</PublishSingleFile> <PublishTrimmed>true</PublishTrimmed> </PropertyGroup> </Project>
Additional Background
install@REDACTED:~$ uname -a
Linux REDACTED 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux