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=220.127.116.11, 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 18.104.22.168 in this project, the version used in this project is 22.214.171.124. 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-126.96.36.199" newVersion="188.8.131.52" /> </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 184.108.40.206 vs 220.127.116.11 where the error was showing 18.104.22.168 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 22.214.171.124 with 126.96.36.199. 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!
Go to references and click on Microsoft.Owin to see which version you have installed ,then go web.config and change the reference under Microsoft.Owin to 188.8.131.52 then go to Package.config and to the same.if you don't want any issues.Install the different package versions on Manage Nudget Packages for all of them and repeat the referencing process you did earlier
User contributions licensed under CC BY-SA 3.0