Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cassette / SignalR integration
public class CassetteConfiguration : ICassetteConfiguration
{
public void Configure(BundleCollection bundles, CassetteSettings settings)
{
//Assuming that you've included the SignalR.Js nuget package this is how you configure
//cassette to correctly order your Scripts and your hub script generated by signalr
bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
bundles.AddUrlWithAlias<ScriptBundle>("http://localhost:50436/signalr/hubs", "signalr-hub", b => { b.AddReference("~/Scripts"); });
}
}
@elerch
Copy link

elerch commented Jan 23, 2013

Thanks for this - I googled AddUrlWithAlias when I was configuring Cassette for SignalR...perfect. To avoid using "localhost:50436" you can use System.Web.Runtime.AppDomainAppVirtualPath, like this:

bundles.AddUrlWithAlias<Cassette.Scripts.ScriptBundle>(
  System.Web.HttpRuntime.AppDomainAppVirtualPath + "/SignalR/Hubs", 
  "SignalR", 
  b => b.AddReference("~/Scripts"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment