Can not load assembly for 'Microsoft.Owin'
Solution 1
It seemed like you confused with SignalR project development. Please read this article.
Solution 2
I suggest to check what you have in packages.config, web.config and packages folder. They all should link to the same package version. Quite often if you update version of some package via NuGet, there may raise compability issues. P.S. If it not help you may delete and istall OWIN again via NuGet.
MohamedAbbas
Updated on June 28, 2022Comments
-
MohamedAbbas almost 2 years
I have an issue in asp.net web API where when I add Signlr class I get. I can see in the references
Microsoft.Owin
Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. >The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Owin' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
-
MohamedAbbas over 9 yearsi have deleted it and installed it again but i still cannot find owin startup class !
-
andrey.shedko over 9 yearsDid you check your packages.config, web.config and packages folder?
-
MohamedAbbas over 9 yearsin the i find packages.config <package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
-
MohamedAbbas over 9 yearsand in all files you mentioned
-
andrey.shedko over 9 yearsSo you're sure that everywhre it reference to the same OWIN version? Ok. Did you re-build solution after you update OWIN via NuGet?
-
andrey.shedko over 9 yearsWhat is in your bin folder? Is it the same OWIN version? You may see your bin folder if you press Show All Files in Solution Explorer.
-
MohamedAbbas over 9 yearsNow i have removed Signlr package and just installed OWIN after i build and run i found no error but still can not find Startup class
-
andrey.shedko over 9 yearsIf I understand what you mean correct, Startup class you must create manually. Here is about Startup class - asp.net/signalr/overview/signalr-20/….
-
MohamedAbbas over 9 yearsYes in the bin folder they are the same
-
MohamedAbbas over 9 yearsso now i create the Startup class and add signlr package !