jQuery 2.0 and NuGet

Recently jQuery 2.0 was released to the world. Yay! It has many breaking changes. Boo! But they are going to keep the 1.x branch updated for the foreseeable future. Yay! NuGet however, does not currently have UI to selectively update only using the 1.x branch of jQuery. Boo!

Enter NuGet version contraints. Simply open up your packages.config, and find the following line:

<package id="jQuery" version="1.9.1" targetFramework="net45" />

Your targetFramework attribute may be different, but that doesn’t matter. What you need to do is edit that line to add the allowedVersions parameter:

<package id="jQuery" version="1.9.1" targetFramework="net45" allowedVersions="[1,2)" />

This tells NuGet that you want to constrain the jQuery package to versions 1 <= x < 2. In fact, if you use Update-Package, you will get a friendly line in the package manager console that reads:

Applying constraint 'jQuery (≥ 1.0 && < 2.0)' defined in packages.config.

Yay! Hopefully the UI for NuGet is updated soon to better support parallel release branches.

Steam and OpenID and MVC

Steam actually offers some options to people who want to build applications and services using their data. One of these options is that they offer Steam as an OpenID provider. MVC 4 actually makes this very easy to consume. I only had to add the following to my AuthConfig.cs to enable it:

using DotNetOpenAuth.AspNet.Clients;
// ... SNIP ....
public static void RegisterAuth() {
    OAuthWebSecurity.RegisterClient(
        new OpenIdClient("Steam", "http://steamcommunity.com/openid"),
        "Steam", null
    )
// ... SNIP ...
}

Magic!

SignalR, easier than you think

I recently became aware of SignalR, an ASP.NET library that allows significantly easier implementation of real-time functionality with web applications. It really became apparent that it  is simple enough that I found an example of a real-time, shared To-Do application called KsigDo with an equally well-written blog post about it. However, when I tried to run and use this application, I found it simply didn’t work. It was written back when SignalR was only at version 0.6, and as happens often enough, the library changed enough that the code no longer worked with SignalR 1.0.1 (latest release at the time of this posting).

All of the changes are detailed in this blog post. If you previously dabbled in SignalR and now stuff isn’t working, you should look here. One of the major changes was that the SignalR nuGet package is now deprecated, and you have to use the Microsoft.AspNet.SignalR package instead. Also, you now have to explicitly call a method to register all of your hubs. You can see the fixed version up on GitHub.