Compiling the DLR, IronRuby, and IronPython for ANY version of Silverlight
I know you feel like this sometimes when trying to solve a problem. I do. Almost all the time. Even when I'm not angry ... but I digress.
Silverlight 2 RC0 was released this past Thursday, but anyone wanting to use the DLR in it was surprised ... no new binary release of the DLR bits for Silverlight 2 RC0 yet. As I said on Twitter, it would be delayed until today, but that shouldn't stop anyone from taking the sources and compiling them against the new SIlverlight build, right?
Of course! Everything should just work, since there were no major breaking changes in Silverlight that affect the DLR between Beta2 and RC0. So, you hacked up the csproj files to point at mscorlib.dll, system.dll, etc in the new Silverlight install directory (C:\Program Files\Microsoft Silverlight\2.0.30923.0), compile, and it builds fine. Then you try to run an app ...
"InitializeError- Failed to load the application. It was built with an obsolete version of Silverlight"
Poof! What the hell happened? That's a really bad error message, but what it means to say is:
"The application's AppManifest.xaml has a RuntimeVersion <= 2.0.30523.00, which is Silverlight 2 Beta 2's version number, so Silverlight 2 RC0 won't load this application."
So you see, the XAP file that was produced by Chiron is still for SL2 Beta2. But that's an easy fix;
- Make sure Chiron.exe isn't running.
- Go to your custom build, and edit Chiron.exe.config
- Find the <AppManifest.xaml> section, and where it says "RuntimeVersion" make it's value be "2.0.30923.0" (anything with the first three version numbers being greater than the current will do, but be save and use the actual version.)
- Re-run Chiron.exe, navigate to your Silverlight application, and .... it works!
Welcome to the wonderful world of versioning in Silverlight. :)