私は、Web APIアプリケーションを作成しようとしていますし、それは私の既存のモンゴデータベースから結果を取得しますが、そうC#ASP.NET Core APIフレームワークでMongoDBドライバを使用するにはどうすればよいですか?
Could not load type 'System.Runtime.Remoting.Messaging.CallContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
An unhandled exception occurred while processing the request.
TypeLoadException: Could not load type 'System.Runtime.Remoting.Messaging.CallContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
MongoDB.Driver.Core.Events.EventContext+AsyncLocal.get_Value()
MongoDB.Driver.Core.Events.EventContext+AsyncLocal.get_Value()
MongoDB.Driver.Core.Events.EventContext.BeginOperation(Nullable<long> operationId)
MongoDB.Driver.Core.Operations.FindCommandOperation.Execute(IReadBinding binding, CancellationToken cancellationToken)
MongoDB.Driver.Core.Operations.FindOperation.Execute(IReadBinding binding, CancellationToken cancellationToken)
MongoDB.Driver.OperationExecutor.ExecuteReadOperation<TResult>(IReadBinding binding, IReadOperation<TResult> operation, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl.ExecuteReadOperation<TResult>(IClientSessionHandle session, IReadOperation<TResult> operation, ReadPreference readPreference, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl.ExecuteReadOperation<TResult>(IClientSessionHandle session, IReadOperation<TResult> operation, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl.FindSync<TProjection>(IClientSessionHandle session, FilterDefinition<TDocument> filter, FindOptions<TDocument, TProjection> options, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl+<>c__DisplayClass35_0.<FindSync>b__0(IClientSessionHandle session)
MongoDB.Driver.MongoCollectionImpl.UsingImplicitSession<TResult>(Func<IClientSessionHandle, TResult> func, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl.FindSync<TProjection>(FilterDefinition<TDocument> filter, FindOptions<TDocument, TProjection> options, CancellationToken cancellationToken)
MongoDB.Driver.FindFluent.ToCursor(CancellationToken cancellationToken)
を行うとき、私は、このエラーが発生します、私は現在、ASPを持っています.NETコアを標的.NETコアフレームワークは2.0
これは、メソッド呼び出しからスローさ
var documents = collection.Find(_ => true).ToList();
明らかに、私が読んでいるリモーティングは.NET Coreではまだサポートされていませんが、MongoDBのWebサイト(https://docs.mongodb.com/ecosystem/drivers/csharp/)では、.NET 2.0でドライババージョン2.4がサポートされています。 2.4ドライババージョンをインストールしましたが、.Findを使用してDBから何かを引き出すことはできません。
私は本当にLinuxではなくウィンドウで使用できるアプリケーションが本当に好きなので、誰にもこれに対する解決策がありますか?
をあなたはMongoDBのドライバ2.4を述べたが、あなたはどのバージョンを正確にあなたが意味するように、より具体的に説明してくださいすることができ、2.4.0、2.4.1など? – ostati