Tjaart
Tjaart

Reputation: 4129

SignalR not working in ASP .Net 5 RC-1

I can't seem to get SignalR 3 working on ASP .Net 5 RC-1 upgrading from Beta8. I tried the latest RC1 package for SignalR but had the following problem. I tried the "Microsoft.AspNet.SignalR.Server": "3.0.0-rc1-15810" package

services.AddSignalR();

is causing the following error:

The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

and app.UseSignalR();

is causing this one:

The type 'IApplicationBuilder' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNet.Http.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

When I switch to the "Microsoft.AspNet.SignalR.Server": "3.0.0-rc2-15909" package I get a runtime error:

An exception of type 'System.TypeLoadException' occurred in mscorlib.dll but was not handled in user code

Additional information: Could not load type 'Microsoft.AspNet.Http.RequestDelegate' from assembly 'Microsoft.AspNet.Http.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

Upvotes: 12

Views: 4193

Answers (3)

Russell McDonnell
Russell McDonnell

Reputation: 150

For anyone who is looking at this page now, the aspnetmaster feed has removed "Microsoft.AspNet.SignalR.Server": "3.0.0-rc1-final"

Upvotes: 0

Stafford Williams
Stafford Williams

Reputation: 9806

I've just tested this, and it looks like a reference to the aspnetmaster myget feed is required, even though this is not mentioned in the installation docs.

Prior to including aspnetmaster I could only resolve Microsoft.AspNet.SignalR.Server 3.0.0-rc1-15810 either directly or by specifying rc1-*, which does not build against rc1-final. Including aspnetmaster gives access to rc1-final.

If you're using Visual Studio 2015, go to Tools > Options > Nuget Package Manager > Package Sources and add a new feed called whatever you like but with source set to https://www.myget.org/F/aspnetmaster/api/v3/index.json.

If you're not using VS2015, or you don't want to edit your machine-wide config, add/edit NuGet.config in your solution root directory to include a package source as follows;

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="aspnetmaster" value="https://www.myget.org/F/aspnetmaster/api/v3/index.json" />
  </packageSources>
</configuration>

Upvotes: 33

Mick Kolesnikov
Mick Kolesnikov

Reputation: 51

Use MyGet sources for "Microsoft.AspNet.SignalR.Server": "3.0.0-rc1-final"

Here related answer, that can be helpful: Can't find Microsoft.AspNet.SignalR.Server 3.0.0-beta7

Upvotes: 5

Related Questions