❔ MongoDB.Driver.MongoConnectionException:

Hi, I have problem with finding document in MongoDB collection. Whenever method collection.find is fired, it throws this error:
MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.MissingMethodException: void System.Security.Cryptography.Rfc2898DeriveBytes..ctor(string,byte[],int,System.Security.Cryptography.HashAlgorithmName)

here's code:
                var client = new MongoClient("here's my uri");
                var database = client.GetDatabase("test");
                var collection = database.GetCollection<PlayerModel>("playerdatas");

                var playerFilter = Builders<PlayerModel>.Filter.Eq("SteamID", player.UserId);
                //this line throws error
                var playerData = collection.Find(playerFilter).FirstOrDefault();


I'm using .NET framework 4.8.1, mongoDB 2.19.1 and Scram-SHA-1.
Anyone know why it's happening?
Was this page helpful?