简体   繁体   English

您可以在Visual Studio 2012中使用SignalR吗?

[英]Can you use SignalR with Visual Studio 2012?

I am trying to put together a SignalR app. 我正在尝试将SignalR应用放在一起。 Totally new to it, so following the MS tutorial, but have fallen at the first hurdle! 完全陌生,因此遵循MS教程,但首先要克服!

I can't add the SignalR Hub Class (v2) as described in this tutorial: 我无法按照本教程中的说明添加SignalR Hub类(v2):

http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-getting-started-with-signalr-20 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... 我正在使用VS2012,所以这可能是我在菜单中看不到它的原因,或者如果我在“添加新项”中查找...

The package installed fine, and I can see it in the package manager, but I can't add the hub class. 程序包安装良好,可以在程序包管理器中看到它,但无法添加集线器类。

是的,只需创建一个空类,然后复制中心类的源和引用即可。

If you want Visual Studio 2012 to show you the SignalR Hub Class (v2) template in the Add | 如果要Visual Studio 2012在“ 添加” |“显示”中向您显示SignalR集线器类(v2)模板, 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 在本教程中使用Visual Studio 2012

To use Visual Studio 2012 with this tutorial, do the following: 要在本教程中使用Visual Studio 2012,请执行以下操作:

  • Update your Package Manager to the latest version. 软件包管理器更新到最新版本。
  • Install the Web Platform Installer . 安装Web平台安装程序
  • In the Web Platform Installer, search for and install ASP.NET and Web Tools 2013.1 for Visual Studio 2012 . 在Web平台安装程序中,搜索并安装Visual Studio 2012的ASP.NET和Web工具2013.1 This will install Visual Studio templates for SignalR classes such as Hub . 这将为SignalR类(例如Hub)安装Visual Studio模板。
  • Some templates (such as OWIN Startup Class ) will not be available; 某些模板(例如OWIN Startup Class )将不可用。 for these, use a Class file instead. 对于这些,请改用Class文件。

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. 就我而言, Web平台安装程序没有找到Visual Studio 2012ASP.NET和Web工具2013.1 ,因此我不得不直接从Web下载它们。 You can download the installer from this link (I used the AspNetWebTools2013_1Setup.exe file). 您可以从此链接下载安装程序(我使用过AspNetWebTools2013_1Setup.exe文件)。

Important Note 重要的提示

The templates don't appear on the Visual C# | 模板不会出现在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# | 本教程中提到的SignalR节点(据我所知,在Visual Studio 2012的“ 新建项”对话框中没有SignalR节点),但它们仍在 Visual C#中出现。 Web node. Web节点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Visual Studio 2012中使用FileSystemWatcher - Can't use FileSystemWatcher in Visual Studio 2012 Visual Studio 2012无法使用Web表单模板 - Visual Studio 2012 Can't use web form template 是否可以在Visual Studio 2012中使用.NET 4.5框架构建Outlook 2010加载项? - Can you build an Outlook 2010 add in using .NET 4.5 framework in Visual Studio 2012? Visual Studio 2012无法找到模板 - Visual Studio 2012 Can't find templates Visual Studio 2012,无法加载项目文件 - Visual Studio 2012, can not load project file 您可以不使用淘汰赛就使用SignalR吗? - Can you use SignalR without using Knockout? 您可以将Visual Studio 2017与SAP .NET Connector 3.0一起使用吗? - Can you use Visual Studio 2017 with the SAP .NET Connector 3.0? 虽然我在解决方案资源管理器中有它们但不能使用文件夹[Visual Studio 2012] - Can't use folders although I have them in Solution Explorer [Visual Studio 2012] 我可以使用Windows 8 Mail App作为使用Visual Studio 2012发送电子邮件的媒介吗? - Can I use Windows 8 Mail App as the medium to send email through using Visual Studio 2012? 无法在Visual Studio 2012的Asp.net中使用SQL Server CE 4.0 - Can't use sql server ce 4.0 in asp.net in visual studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM