Introduction

This is the application created in the Getting Started with SignalR 2.0 and MVC 5 tutorial.

Building the Sample

After opening the project in Visual Studio 2013, open the Package Manager Console and click Restore to install the required SignalR components.

Description

This tutorial introduces you to real-time web application development with ASP.NET SignalR 2.0 and ASP.NET MVC 5. The tutorial uses the same chat application code as the SignalR Getting Started tutorial, but shows how to add it to an MVC 5 application.

In this topic you will learn the following SignalR development tasks:

   

 

C#
Edit|Remove
using System; 
using System.Webusing Microsoft.AspNet.SignalRnamespace SignalRChat 
{ 
    public class ChatHub : Hub 
    { 
        public void Send(string name, string message) 
        { 
            // Call the addNewMessageToPage method to update clients. 
            Clients.All.addNewMessageToPage(name, message); 
        } 
    } 
} 
 
using Owin; 
using Microsoft.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(); 
        } 
    } 
}

Source Code Files

More Information

For more information on SignalR and the Getting Started tutorial, see http://www.asp.net/signalr.