question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0'

See original GitHub issue

Hello, I am encoutering this error on my ASP.NET web application : 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 do indeed have a dependency to Microsoft.Owin in my project. But my project is using the latest version (4.0.1.0) and in my web.config my redirects are configured to redirect to it.

<dependentAssembly> <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> </dependentAssembly>

Here is where it get’s weird. Locally, it works just fine, I can build it and run it in debug or release mode. The build in my build pipeline on Azure DevOps also works great.

However, the deployed version (deployed in Azure) does not work. The landing page (which is a login page) works fine, but as soon as I try and login, I get a yellow screen wih this message:

`An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

[WebException: The remote server returned an error: (500) Internal Server Error.] System.Net.HttpWebRequest.GetResponse() +1399 System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +55

[ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: ’ `<!DOCTYPE html>

<html> <head> <title>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)</title> <meta name="viewport" content="width=device-width" /> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt} .marker {font-weight: bold; color: black;text-decoration: none;} '.]`

I have tried every fix I could find online, had help from multiple people and nothing could fix this. Looking forward to get your answers. Cheers

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jabsaidicommented, Jan 22, 2020

Giving anybody who comes accross this issue the “solution” that worked for me. I published my app from Visual Studio. There is a checkbox that needs to be checked to ensure that basically a clean is done on the environment. It worked this way. I thought I configured my Azure DevOps release pipeline to do the same task but apparently for some reason (most likely my fault) it wasn’t done right.

Screenshot_30

0reactions
jabsaidicommented, Jan 20, 2020

Thank you for your advice. I have opened a ticket with Microsoft Support and will post the solution once it is all figured out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asp.net mvc - NuGet Package restore failed for project ...
Based on your error message looks like you are looking for a version that no longer exists and cannot tell which Package source...
Read more >
ASP.NET Core 3.1.0 site won't run - Could not load ...
According to the logs, the error is in the Startup.cs file, ... FileNotFoundException: Could not load file or assembly 'Microsoft.
Read more >
Package restore intermittently fails with "Unable to find ...
I had to point the feed to v3 to make it work: ... Source: file://\\server\packages Unable to find version '2.6.4.0' of package 'Company....
Read more >
Scaffolding ADO.NET Entity Data Model Designer-based ...
This provider can work with a Model (either Code First or Model First) which was created using Entity Framework 6. This package also...
Read more >
Issues with zbu.ModelsBuilder
1) The current models builder will not generate models due to a version conflict detailed here: Zbu ModelsBuilder: API version conflict I have ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found