I created a new WebAPI project (VS 2013, .net framework 4.5.1, c#) with the example template, Added a new controller and tested this on my local computer. In my computer, everything is working good (debug \ release).
When publishing this to Azure hosting, I'm getting this error message:
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()
I have no clue what the reason. So, I Googled it. Solutions I'm have tried:
- According to this report, I'm tried to add this (Microsoft.Owin.Host.SystemWeb) nuget package, without solving my problem.
- According to this solution, the user advice to change some code line to this: Microsoft.AspNet.WebApi.Owin(UseOwinMethod)
I'm didn't understand, where I'm should place this code line (and replace which code line in my existing project).
Thank you for helping.