The SharePoint 2010 BlobCache Manager enables you to control the BlobCache settings from Central Admin. You don’t have to maintain these settings on each web frontend manually. As benefit you get fewer database requests and faster page loads.
As usual, I would love to hear your feedback – or if I should review your favorite tool, drop me a line!
If you never heard of SignalR – it’s a real-time web framework for bi-directional communication between a client and server – in short: your server (here SharePoint) can notify a client that something very important happened. Let’s say you want to have Task List and a Dashboard where you can see how many tasks are open (you can watch this example here by Matt Menezes)– in real-time, without hitting F5 permanently and without having an AJAX function polling the list every second. With SignalR that’s possible and the good thing its very easy, some say its magic! I did a small example for visualizing downloads from my SharePoint farm and IMHO it looks very cool. Things change rapidly, as I wrote this I used Microsoft.AspNet.SignalR 1.0 Alpha 2.
Update 02/05/2013: SignalR has changed a lot – I will write a blog post because the current approach is to complicated for the current SignalR version. Use at your own risk!
Update 06/05/2013: Open Source Solution available – I released a Codeplex project for SharePoint+SignalR. Please go to http://spsignalr.codeplex.com
SharePoint 2010 makes it tough!
You all know that SharePoint 2010 runs on .NET Framework 3.5 – yepp, its not getting better. Thing is, SignalR needs .NET Framework 4.0 or 4.5. So the easiest solution was to create a second Application Pool, select .NET Framework 4.0/4.5 and host the SignalR application there. I used a WCF Service in that application, SharePoint event receivers can call the WCF Service and voila you are in the 4.0/4.5 domain (if you are lucky without cross domain issues…).
SharePoint 2013 doesn’t make it easier!
Then SharePoint 2013 came out – finally with .NET 4.0 runtime. I said cool, this should make it easy to host SignalR in the same domain and even in the same Application Pool as SharePoint 2013. Yepp, that’s the theory and SharePoint can sometimes make it a little bit harder than it should be (still, SharePoint 2013 is a rock star!!!).
SignalR Hub in SharePoint 2013
When you create a SignalR application you need a hub. A hub is a class with methods you can call from the clients or externally to notify other clients. In order to communicate all clients need to register on that hub. In normal asp.net world SignalR attaches to the App_Start event where it registers a route “~/signalr/hubs” so clients know the endpoint where they can talk to SignalR hubs or get the hub description file (proxy). With this behavior you have a problem:
There is no App_Start
(You could modify the global.asax – but I want a deployable solution…)
App_Start the SharePoint way
The only deployable way I could imagine to call a function once the app pool spins up – with several farm nodes – is a http handler. Wait a http handler is call very often, we need to remember this one:
//nothing to clean up.
//check if the routes are already attached
//lock it, could be called several times in parallel
//check if the call before attached.
//this is usually call in the App_Start thing from SignalR and registers the hub endpoint
Now we need to add this module to the web.config farm wide – easiest way is the SPWebConfigModification and a Web Application feature.
Note: The uninstalling method is not shown here, don’t forget it because the SPWebConfigModification remembers the changes!
With that the route will register – only once – and we should be all set right?
SharePoint 2013 yellow page of death
Nasty stack trace
Stack trace: at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.IsExcludedPath(String virtualPath)
at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.DirectoryExists(String virtualPath)
at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)
at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
That doesn’t sound good.
SharePoint and the ~
SharePoint doesn’t like the tilde character. If you add a route (if you don’t, SignalR does) starting with ~, SharePoint shows the yellow page of death. The “easy” fix is to create a custom VirtualPathProvider – I didn’t know what this class is doing before, too – and just pretend the ~ is not there:
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.