C# Problem of Connecting to Database Using MongodbDriver2.4.4

  mongodb, question

The following error was reported. The System.Runtime.InteropServices.RuntimeInformation.dll used is version 4.0.0
500 failed to load the file or assembly “system.runtime.interopservices.runtime information, version = 4.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a” or one of its dependencies. The assembly manifest definition found does not match the assembly reference. (Exception from HRESULT:0x80131040)

System.IO.FileLoadException: failed to load file or assembly “system.runtime.interopservices.runtime information, version = 4.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a” or one of its dependencies. The assembly manifest definition found does not match the assembly reference. (Exception from HRESULT:0x80131040)
File name: “system.runtime.interopservices.runtime information, version = 4.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a”
At mongodb.driver.core.connections.clientdocumenthelper.createosdocument ()
Lazy`1.createvalue ()
-End of stack trace in previous position where exception was thrown-
At system.runtime.exceptionservices.exceptiondispatchinfo.throw ()
Lazy`1.get _ value ()
In mongodb.driver.core.connections.clientdocumenthelper.createclientdocument (stringapplication name)
In mongodb.driver.core.connections.binaryconnectionfactory .. director (connectionsettings, istream factory, ieventsubscriber eventsubscriber)
At mongodb.driver.core.configuration.clusterbuilder.buildcluster ()
At mongodb.driver.clusterregistry.createcluster
At mongodb.driver.clusterregistry.getorcreatecluster (clusterkeyclusterkey)
In mongodb.driver.mongocolient.vector (mongocolientsettings)
In ZKweb.ORM.MongoDB.MongoDentityMappings.CTOR (MongoURL ConnectionURL, IEnumerable1 handlers, IEnumerable1 providers)
In zkweb.ORM.mongodb.mongoddbdatabasecontextfield.vector (stringdatabase, stringconnectionstring, ienumerable1 handlers, IEnumerable1 providers)

Warning: assembly binding logging is turned off.
To enable assembly binding failure logging, set the registry value [hklmsoftwaremicrossoftusion! EnableLog] (DWORD) is set to 1.
Note: There will be some performance loss associated with assembly binding failure logging.
To turn off this feature, remove the registry value [hklmsoftwaremicrossoftusion! EnableLog]。

Solution

Attempt to installVC++ library

Mongodb compatibility

C# and .NET MongoDB Driver

clipboard.png