4

So I have installed SignalR through Nuget and it is depending on Microsoft.Owin which it then installed. Whenever I run my application it throws a FileLoadException in the Startup.cs om the app.MapSignalR(); line. It says "File or assembly 'Microsoft.Owin, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies could not be loaded. The manifest definition of the found assembly do not match the reference of the assembly."

I am sure it includes the Microsoft.Owin.dll but when I try to reinstall it through Nuget it says it could not reinstall the Microsoft.Owin.XML

Startup.cs

using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(SignalRChat.Startup))]
namespace SignalRChat
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            // Any connection or hub wire up and configuration should go here
            app.MapSignalR();
        }
    }
}
Zinoex
  • 512
  • 2
  • 8
  • 22

2 Answers2

4

Sometimes packages refer to specific versions of other packages. You can try to add a binding redirect for Microsoft.Owin in your web.config file (in the <runtime> section):

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

This tells everything that references an older version than 2.1.0.0 to use 2.1.0.0 instead.

Knelis
  • 6,782
  • 2
  • 34
  • 54
  • That was in fact already added to the `web.config` by the Nuget manager. So this did not solve anything. – Zinoex Feb 27 '14 at 09:11
0

The latest version of SignalR relies on Microsoft.Owin 2.0.2.0, not 2.0.1.0. See the following tutorial- you'll want to add Microsoft.AspNet.SignalR.SelfHost in the package manager, not Microsoft.Owin.

http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-signalr-20-self-host

  • That did in fact not solve anything as it does the exact same thing when calling `app.MapSignalR();`. The only difference is that it is now `Microsoft.Owin.Security` instead of just `Microsoft.Owin`... – Zinoex Mar 06 '14 at 10:22
  • It was because that it aimed at a higher version than it was set to redirect in the app.config – Zinoex Mar 06 '14 at 10:27