There are few steps to enable SignalR into a web application. But how do this for a SharePoint based web application?
The goal of this project is provide you a SharePoint deployment package to automate such steps for a SharePoint web application.
The only thing you have to do is:
-
Build this sources or direct download SignalR.SharePoint.wsp.
-
Install and deploy SignalR distributed assemblies -in the SignalR.SharePoint.wsp package file- to the web application bin directory from a Powershell console:
Add-PSSnapin Microsoft.SharePoint.PowerShell Add-SPSolution (Resolve-Path .\SignalR.SharePoint.wsp) Install-SPSolution SignalR.SharePoint.wsp -WebApplication $WebAppUrl -GACDeployment -FullTrustBinDeployment -Force
-
Enable [SignalR SharePoint Configuration Feature] - in the web application scope - in order to modify the web.config for run-time assembly binding redirection, set legacyCasModel to false (allow dynamic calls) and set the owin:AutomaticAppStartup application setting key to false
... ... ... ... ...
-
Create and deploy your hub based assembly into the web application. The easy way to do this is by writing the hub in a SharePoint based project and set the "Assembly Deployment Target" to WebApplication. You can also try with this simple chat example by deploying it into your web application.
-
Enable the [SignalR SharePoint Enable AutomaticAppStartup Feature] - in the web application scope - in order turn the owin:AutomaticAppStartup application setting key to true.
... -
Just open your browser and navigates to the application page. If you deployed the chat example, you can try with %WebApplicationUrl%/_layouts/15/_layouts/15/SignalR.SharePoint.Demo/Chat.aspx application page.