Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

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=3.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 don't even have a Microsoft.Owin Version 3.0.1.0 in this project, the version used in this project is 2.0.0.0. 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-3.0.1.0" newVersion="3.0.1.0" />
</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)

like image 464
Ng Zen Avatar asked Oct 11 '17 11:10

Ng Zen


1 Answers

Verify the installed Microsoft.Owin package version [In Manage Nuget Packages] with Web.config -> Microsoft.Owin version.

Both these versions should match.

This one worked for me

like image 97
Sadiq Avatar answered Sep 27 '22 20:09

Sadiq