copper spinner
copper spinner

Reputation: 43

NuGet version coflict with SignalR and Owin

I’m trying to setup up a selfhosted SignalR & WebAPI project with owin, following this ( https://www.youtube.com/watch?v=2prTfk0n9x0 ) but I quickly ran into issues. My project creates a class library which is loaded by my main application.

As shown in the video I've installed three NuGet Packages:

While loading my library an exception occurs telling me, that the package Microsoft.AspNet.SignalR.Core (2.4.1.0) tries to load Microsoft.Owin Version 2.1.0.0 but it found a differed version (4.0.1).

I've added:

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

To both app.config files, the one of my library project and the one of my main application but with no effect. I'm not very familiar with nuget so I ran out of ideas how to solve this problem.

This is the full (german) Exception text + additional information:

    Die Datei oder Assembly \"Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)

    === Zustandsinformationen vor Bindung ===
    LOG: DisplayName = Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\n (Fully-specified)
    LOG: Appbase = file:///C:/projects/MyApp/bin/Debug/
    LOG: Ursprünglicher PrivatePath = NULL
    Aufruf von Assembly : Microsoft.AspNet.SignalR.Core, Version=2.4.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: Diese Bindung startet im default-Load-Kontext.
    LOG: Die Anwendungskonfigurationsdatei wird verwendet: C:\\projects\\MyApp\\bin\\Debug\\MyApp.exe.Config
    LOG: Die Hostkonfigurationsdatei wird verwendet: 
    LOG: Die Computerkonfigurationsdatei von C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\config\\machine.config wird verwendet.
    LOG: Verweis nach der Richtlinie: Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    LOG: Download von neuem URL file:///C:/projects/MyApp/bin/Debug/Microsoft.Owin.DLL.
    WRN: Der Vergleich des Assemblynamens führte zum Konflikt: Hauptversion.
    ERR: Das Setup der Assembly konnte nicht abgeschlossen werden (hr = 0x80131040). Die Suche wurde beendet.

/Edit as result of Matěj Štágl's answer:

I forgot to mention, that I tried to downgrade already, but it just forced me do downgrade more and more, because all dependencies must be downgraded, too.

I just did it again to give an idea of it:

Upvotes: 2

Views: 505

Answers (1)

Matěj Št&#225;gl
Matěj Št&#225;gl

Reputation: 1037

Simple solution would be to install the version of owin SignalR calls for. Open nuget packages manager, select installed tab, select Microsoft.Owin and in the right panel, under version dropdown select 2.1:

enter image description here

Alternatively you can do the same via Package Manager Console:

Install-Package Microsoft.Owin -Version 2.1.0.0

Upvotes: 1

Related Questions