Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't seem to install SignalR with MVC4

I'm brand new to SignalR and I've been following along with the Microsoft Academy MVC 4 tutorials. I've hit a road block when it comes to installing SignalR.

Steps: Create a brand new MVC4 web application (Internet Application), Build, Go to the NuGet package manager and find "Microsoft ASP.NET SignalR", Press install. I get the following error message: "Unable to uninstall 'Newtonsoft.Json 5.0.8' because 'Microsoft.AspNet.WebApi.Client 4.0.20710.0' depends on it."

If I attempt a second time I get the follow error: "Could not install package 'Microsoft.Owin.Security 2.0.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."

I've tried all of the built in templates already. The demo seems to be using VS2012 (which I am) so I don't understand what the issue is. I did notice that when I pause the demo they are installing v1.1.3 while mine is at v2.0.0

I'm semi-new to MVC, brand new to nuget and SignalR. If anyone has any tips or alternatives I'd appreciate it.

like image 536
BrianLegg Avatar asked Oct 26 '13 01:10

BrianLegg


2 Answers

It seems that a couple of days ago (17th October), a new version of SignalR was released (version 2.0.0), which uses a new version of Microsoft.OWIN.Security that requires .NET4.5. To get around this, I simply installed the previous version (1.1.3) using the following Package Manager Console command:

install-package Microsoft.AspNet.SignalR -Version 1.1.3
like image 185
Gareth Cornish Avatar answered Dec 23 '22 05:12

Gareth Cornish


My understanding of Nuget packages is a bit ropey, but I managed to overcome this (Owin) issue by

  1. Using Nuget Package explorer to open the Microsoft.Owin.Security 2.0.1 package from an online feed

  2. Moving the DLL and XML file out of the .Net 4.5 folder and directly into lib

  3. Saving the package locally

  4. Adding local version of the package

I'm currently using VS2010, but everything was working fine yesterday in VS2012. I wanted to use nuget rather than just dropping DLLs into the bin folder, as it makes things easier later on when I need to clean up and do things properly.

The above is something of a hack and I fully expect the real experts on this stuff to recommend I be placed in a sack and beaten with a stick for even suggesting it. However, I needed to get it working right now for a demo.

like image 37
Justin Avatar answered Dec 23 '22 05:12

Justin