Skip to content

Instantly share code, notes, and snippets.

@tkarpinski
Created February 10, 2012 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkarpinski/1790745 to your computer and use it in GitHub Desktop.
Save tkarpinski/1790745 to your computer and use it in GitHub Desktop.
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