My code works just fine locally but after I published to server I keep getting this error:
Could not load file or assembly 'Microsoft.Owin, Version=184.108.40.206, 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 don't even have a Microsoft.Owin Version 220.127.116.11 in this project, the version used in this project is 18.104.22.168. Then I tried to update the Owin and the dependencies file but to no avail. Even after deleting the Bin folder and rebuild the code I am still having the same issue.
Anybody can help me on this?
EDIT: After adding this to the Web.Config:
<dependentAssembly> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-22.214.171.124" newVersion="126.96.36.199" /> </dependentAssembly>
This is what I got:
Could not load file or assembly 'file:///C:\Project\bin\Microsoft.Owin.dll' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I had the same issue for 188.8.131.52 vs 184.108.40.206 where the error was showing 220.127.116.11 so make sure to check Web.config and set to correct version that is in the .csproj. In my case, I had to update Web.config and replace 18.104.22.168 with 22.214.171.124. The updating package did nothing until the versions matched.
I've also had this a few times. Installing the nuget package (and accepting the license) always did the trick for me.
so, rightclick your project in visual studio (?), manage nuget-packages. Look for installed tab, delete if so. Then tab browse, and look for Microsoft.Owin (there are a few), install them and you are ready to go!
User contributions licensed under CC BY-SA 3.0