Can not load assembly for 'Microsoft.Owin'

11,435

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.

Share:
11,435
MohamedAbbas
Author by

MohamedAbbas

Updated on June 28, 2022

Comments

  • MohamedAbbas
    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
    MohamedAbbas over 9 years
    i have deleted it and installed it again but i still cannot find owin startup class !
  • andrey.shedko
    andrey.shedko over 9 years
    Did you check your packages.config, web.config and packages folder?
  • MohamedAbbas
    MohamedAbbas over 9 years
    in the i find packages.config <package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
  • MohamedAbbas
    MohamedAbbas over 9 years
    and in all files you mentioned
  • andrey.shedko
    andrey.shedko over 9 years
    So 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
    andrey.shedko over 9 years
    What 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
    MohamedAbbas over 9 years
    Now 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
    andrey.shedko over 9 years
    If I understand what you mean correct, Startup class you must create manually. Here is about Startup class - asp.net/signalr/overview/signalr-20/….
  • MohamedAbbas
    MohamedAbbas over 9 years
    Yes in the bin folder they are the same
  • MohamedAbbas
    MohamedAbbas over 9 years
    so now i create the Startup class and add signlr package !