Ben
Ben

Reputation: 4319

Can you use SignalR with Visual Studio 2012?

I am trying to put together a SignalR app. Totally new to it, so following the MS tutorial, but have fallen at the first hurdle!

I can't add the SignalR Hub Class (v2) as described in this tutorial:

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

I am using VS2012, so this may be the reason I can't see it in the menu, or if I look in Add New Item...

The package installed fine, and I can see it in the package manager, but I can't add the hub class.

Upvotes: 2

Views: 5948

Answers (2)

dcontard
dcontard

Reputation: 135

If you want Visual Studio 2012 to show you the SignalR Hub Class (v2) template in the Add | New Item dialog, you can follow these instructions shown in the same tutorial page (they are not easy to catch, I didn't see them the first time either):

Using Visual Studio 2012 with this tutorial

To use Visual Studio 2012 with this tutorial, do the following:

  • Update your Package Manager to the latest version.
  • Install the Web Platform Installer.
  • In the Web Platform Installer, search for and install ASP.NET and Web Tools 2013.1 for Visual Studio 2012. This will install Visual Studio templates for SignalR classes such as Hub.
  • Some templates (such as OWIN Startup Class) will not be available; for these, use a Class file instead.

In my case, the Web Platform Installer didn't find the ASP.NET and Web Tools 2013.1 for Visual Studio 2012, so I had to download them directly from the web. You can download the installer from this link (I used the AspNetWebTools2013_1Setup.exe file).

Important Note

The templates don't appear on the Visual C# | Web | SignalR node as mentioned in the tutorial (there is no SignalR node on the New Item dialog box in Visual Studio 2012, as far as I can note), but they appear nonetheless in the Visual C# | Web node.

Upvotes: 1

hutchonoid
hutchonoid

Reputation: 33306

Yes, just create an empty class instead & copy the source and references for the hub class.

Upvotes: 2

Related Questions