我已经使用MongoDB实现了自定义Identity 3.0提供程序 . 它在localhost中工作正常,但是当我将它上传到Azure时,我有这样的错误:

处理请求时发生未处理的异常 . MissingMethodException:找不到方法:'Void MongoDB.Driver.FindOptionsBase.set_AllowPartialResults(Boolean)' . MyProject.Web.Identity.UserStore`3.FindByNameAsync(String normalizedUserName,CancellationToken cancellationToken)

RAW Details Error:

System.MissingMethodException:找不到方法:'Void MongoDB.Driver.FindOptionsBase.set_AllowPartialResults(Boolean)' . at MyProject.Web.Identity.UserStore 3.FindByNameAsync(String normalizedUserName, CancellationToken cancellationToken) at Microsoft.AspNet.Identity.UserManager 1.FindByNameAsync(String userName)at Microsoft.AspNet.Identity.SignInManager`1.d__31.MoveNext()

在UserStore.cs中抛出错误的方法:

/// <summary>
        /// Finds and returns a user, if any, who has the specified normalized user name.
        /// </summary>
        /// <param name="normalizedUserName">The normalized user name to search for.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be cancelled.</param>
        /// <returns>
        /// The <see cref="Task"/> that represents the asynchronous operation, containing the user matching the specified User if it exists.
        /// </returns>
        public virtual Task<TUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();

            if (string.IsNullOrWhiteSpace(normalizedUserName)) return Task.FromResult((TUser)null);

            var filter = Builders<TUser>.Filter.Eq(x => x.Email, Normalize(normalizedUserName));
            var options = new FindOptions { AllowPartialResults = false };

            return DatabaseContext.UserCollection.Find(filter, options).SingleOrDefaultAsync(cancellationToken);
        }

我已在localhost中测试连接到“ 生产环境 数据库”,我没有这个错误,一切正常 .

我正在使用MongoDb Driver C#2.1.1 .

为什么在Localhost中工作而不在Azure中工作?如果删除AllowPartialResults会发生什么?

谢谢 .