Deployment Error: Could not load file or assembly 'Microsoft.Owin' or one of its dependencies

3

I am getting this error after the deployment/publishing to server. In my local it works fine but on server i am getting this error.

I checked my package.config and .dll version in my bin project folder. At both the places versions are same.

Please let me know what can be the issue.

Exception:

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)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.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)

asp.net
asp.net-mvc-4
asp.net-web-api
owin
.net-assembly
asked on Stack Overflow May 16, 2017 by Avdhoota • edited Apr 29, 2020 by Avdhoota

1 Answer

3

this is caused by assembly version miss match, and can be fixed by Redirecting Assembly Versions , please refer to https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions . And redirections can be generated by vs automatically, please refer to https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection

answered on Stack Overflow Apr 27, 2020 by Andrew

User contributions licensed under CC BY-SA 3.0