I have very simple ASP.NET Project that works just fine when I run it from Visual Studio, but after I publish to Azure Web App I get this error
Could not load file or assembly 'Microsoft.Owin.Security, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I looked everywhere and I am not using - at least not intentionally - this assembly and it's not listed on Web.config or Package.config or anywhere if I do a search within the solution.
I really don't know what I am missing here. Maybe a configuration from Azure side.
Here is the Stack Trace
[FileLoadException: Could not load file or assembly 'Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] SampleWebApp.Startup.ConfigureAuth(IAppBuilder app) +0 SampleWebApp.Startup.Configuration(IAppBuilder app) +5
[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +136 Owin.Loader.<>c__DisplayClass12.b__b(IAppBuilder builder) +66 Owin.Loader.<>c__DisplayClass1.b__0(IAppBuilder builder) +123 Microsoft.Owin.Host.SystemWeb.<>c__DisplayClass2.b__0(IAppBuilder builder) +71 Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action
1 startup) +462 Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action
1 startup) +40 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +70 System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115 Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +537 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +364 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +290[HttpException (0x80004005): Exception has been thrown by the target of an invocation.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +4531288 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +94 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +191