title: After publishing to Azure assembly Microsoft.Owin could not be load
body: <p>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 </p>
  
  <blockquote>
    <p>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)</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>I really don't know what I am missing here. Maybe a configuration from Azure side.</p>
  
  <p>Here is the Stack Trace</p>
  
  <blockquote>
    <p>[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</p>
    
    <p>[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.&lt;>c__DisplayClass12.b__b(IAppBuilder builder) +66
       Owin.Loader.&lt;>c__DisplayClass1.b__0(IAppBuilder builder) +123
       Microsoft.Owin.Host.SystemWeb.&lt;>c__DisplayClass2.b__0(IAppBuilder builder) +71
       Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action<code>1 startup) +462
       Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action</code>1 startup) +40
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +70
       System.Threading.LazyInitializer.EnsureInitializedCore(T&amp; target, Boolean&amp; initialized, Object&amp; 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</p>
    
    <p>[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</p>
  </blockquote>