更新documentt documentDB sdk .net到1.10.0或找不到最新方法

时间:2017-04-01 09:52:20

标签: asp.net .net azure sdk azure-cosmosdb

将Document Db SDK .NET更新为1.10.0或更新,登录时将异常更新。

[MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<Microsoft.Azure.Documents.Client.FeedResponse`1<!!0>> Microsoft.Azure.Documents.Linq.IDocumentQuery`1.ExecuteNextAsync()'.]
   DocumentDB.AspNet.Identity.<GetUsers>d__9.MoveNext() +0
   System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start(TStateMachine& stateMachine) +94
   DocumentDB.AspNet.Identity.UserStore`1.GetUsers(Expression`1 predicate) +146
   DocumentDB.AspNet.Identity.<FindByNameAsync>d__17.MoveNext() +366
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.AspNet.Identity.CultureAwaiter`1.GetResult() +59
   Microsoft.AspNet.Identity.<FindAsync>d__12.MoveNext() +267
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28
   Rezzame.Providers.<GrantResourceOwnerCredentials>d__2.MoveNext() in D:\Project\rezzame\Rezzame\Providers\ApplicationOAuthProvider.cs:39
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Security.OAuth.<InvokeTokenEndpointResourceOwnerPasswordCredentialsGrantAsync>d__3f.MoveNext() +466
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +25
   Microsoft.Owin.Security.OAuth.<InvokeTokenEndpointAsync>d__22.MoveNext() +1548
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +25
   Microsoft.Owin.Security.OAuth.<InvokeAsync>d__0.MoveNext() +1103
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +435
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +638
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.AspNet.Identity.Owin.<Invoke>d__0.MoveNext() +404
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +182
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__2.MoveNext() +180
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +69
   Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +64
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +380
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

ApplicationOAuthProvider.cs此处发生错误

Line 39:             ApplicationUser user = await userManager.FindAsync(context.UserName.ToLower(), context.Password);

初始用户管理器

 public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context) 
    {
        var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(new Uri(ConfigurationManager.AppSettings["Endpoint"]), ConfigurationManager.AppSettings["AuthKey"], ConfigurationManager.AppSettings["Database"], "Users"));

DocumentDB ASP.Net Identity是v1.0.10-beta

注意:某些方法在SDK中无法获取数据,在更新项目中的所有SDK后,它们开始工作但无法登录。

有人知道它可能是什么?

1 个答案:

答案 0 :(得分:0)

我使用demo code测试了DocumentDB ASP.Net Identity [v1.0.10-beta]。它在我身边正常工作。以下是我的详细步骤。请参阅检查。

  1. 从github

  2. 下载demo code
  3. 使用我的documentdb信息

  4. 更改IdentityConfig

    enter image description here

    1. 运行演示代码本地和注册表用户。然后我可以找到用户可以登录并从Azure门户获取注册用户
    2. enter image description here

      4.在包管理器控制台(View&gt; Other Windows&gt; Package Manager Console)中输入:

      Install-Package DocumentDB.AspNet.Identity -Pre
      
      1. 尝试使用注册用户登录
      2. enter image description here

        1. 根据错误信息,将Newtonsoft.Json版本更新为10.0.2

        2. 使用自定义集合注册其他用户

        3. enter image description here

          1. 成功登录注册用户。
          2. enter image description here