【问题标题】:InvalidOperationException: No OWIN authentication manager is associated with the requestInvalidOperationException:没有 OWIN 身份验证管理器与请求关联
【发布时间】:2015-04-03 16:51:13
【问题描述】:

我使用示例模板创建了一个新的 WebAPI 项目(VS 2013,.net framework 4.5.1,c#),添加了一个新控制器并在我的本地计算机上进行了测试。在我的电脑中,一切正常(调试\发布)。

将其发布到 Azure 托管时,我收到以下错误消息:

ExceptionMessage=No OWIN authentication manager is associated with the request.
ExceptionType=System.InvalidOperationException
Message=An error has occurred.
StackTrace=   at System.Web.Http.Owin.PassiveAuthenticationMessageHandler.SuppressDefaultAuthenticationChallenges(HttpRequestMessage request)
   at System.Web.Http.Owin.PassiveAuthenticationMessageHandler.<SendAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()

我不知道是什么原因。所以,我用谷歌搜索了它。 我尝试过的解决方案:

我不明白,我应该在哪里放置此代码行(并替换我现有项目中的哪个代码行)。

感谢您的帮助。

【问题讨论】:

    标签: c# asp.net azure asp.net-web-api asp.net-web-api2


    【解决方案1】:

    好的。我找到了解决此问题的解决方法。

    我的解决方法, 我已经完成的步骤:

    1. 我刚刚创建了一个新的 WebAPI 项目(默认模板)并将其上传到 Azure 中的新网站。测试了它。这工作得很好。所以,从这里我明白问题不在我的代码中。
    2. 现在我上传了我的新项目并覆盖了我现有的不工作的项目。现在,我的新项目也停止工作了。和我之前的项目一样的问题。
    3. 此时,我了解到我的 Azure 帐户出现问题。所以我删除了我的旧网站帐户并重新创建它。现在它工作正常。

    所以,请尝试删除并再次上传您的项目。

    【讨论】:

      猜你喜欢
      • 2014-02-01
      • 1970-01-01
      • 2014-11-14
      • 2015-10-09
      • 2019-10-19
      • 2012-12-22
      • 2016-03-24
      • 2015-09-23
      • 2023-04-05
      相关资源
      最近更新 更多