Just loved the team's latest Silverlight video. Props to Adam, Laura, Nic, Monica, Dan, Scott and Tina.
As many people will have noticed, we released Windows Vista Service Pack 1 this week (read about the notable changes here). Aside from the inevitable bug fixes and enhancements to support new hardware types, one of the underlying changes is that SP1 brings the Windows Vista and Windows Server 2008 codebases together.
This is a big deal, but it's surprising how few people have noted it: this is the first time we've ever had a common codebase for Windows that goes all the way from a budget consumer PC right up to a mainframe-class datacenter server. Internally to Microsoft, this makes it easier for us to provide sustained engineering on the product: if we want or need to update a system component, we only have to produce two binaries (x86 and x64) for all languages and product editions. Compare that to the days of Windows XP/2003, when we had maybe 25 different language editions and x86 and x64 variants for both client and server OS releases, and you can see how the testing matrix has become a lot simpler! Externally, the benefit is of course that simply by updating to SP1, you get the benefit of a kernel that has been through an extensive server-hardening process. (Check out this Channel 9 video I recorded last year with Eric Hanson to get just a small flavor of the stress testing work that we do with every build.)
Beyond the kernel and subsystem improvements, Windows Vista SP1 brings major improvements to IIS 7. Comparing the original Windows Vista "RTM" version against that shipped with SP1 is like comparing the basic and premium models of a car - the SP1 version of IIS contains all the features added to create the server-strength edition (with the caveat that Windows Vista SP1 is obviously not licensed for use as a commercial-scale production Internet web server). As a crude measure, compare the two screenshots of the administration console below - the left image is of Windows Vista RTM, the right is of SP1:
You'll see other changes to Windows Vista that affect certain relatively niche groups of developers. Direct3D receives a minor update to 10.1; there are new APIs to control the Data Execution Protection and Kernel Patch Protection features; and there are new cryptographic and random number generation algorithms available for developer use. As ever, more information about these features can be found in the Windows SDK.
As a .NET developer, you'll notice that Vista SP1 updates the installed .NET components to .NET Framework 3.0 Service Pack 1. The good news is that many of the enhancements from .NET Framework 3.5 are included in 3.0 SP1 - for example, of the list of fifteen enhancements to WPF described in this blog post, everything apart from System.AddIn and the Firefox XBAP support is included in Windows Vista SP1. This is a little bit confusing, but it probably helps to know that each of the last .NET Framework releases have built on top of each other, rather than existing side-by-side. The diagram to the right demonstrates this.
As a result, all the CLR and class library enhancements that were made to existing assemblies in 3.5 are incorporated in 3.0 SP1 (mscorlib.dll is updated from 2.0.50727.312 to 2.0.50727.1434); the binaries are identical to those shipped with .NET Framework 3.5. The only difference between 3.0 SP1 and 3.5 is that 3.0 SP1 doesn't have any of the new assemblies ("green bits") added in 3.5 for new capabilities like LINQ. Of course, if you've already installed .NET Framework 3.5 on your Windows Vista machine prior to installing SP1, you'll still have the full 3.5 release on your machine afterwards.
The many other nice features in SP1 for end-users and IT Professionals are outside of the scope of this entry, but suffice it to say that some of the major peeves have been addressed: UAC is less aggressive, file copy performance has been greatly improved (and it takes less time to "estimate"!), application compatibility is better, resuming from standby is faster, and over a thousand bugs have been fixed. For more detail on all these items, check out the main Windows Vista Service Pack 1 site.
It's worth noting in closing that many of the above fixes at least have been delivered via Windows Update over the last twelve months. We're moving away from the old-school approach where service packs were the main way that fixes were delivered to a more agile model where patches are available via Windows Update (or its enterprise equivalent, WSUS) and then rolled into a service update at a later stage. The goal is to reduce the gap between us fixing something and you seeing the results of that fix.
Well, what are you waiting for? Go install Windows Vista Service Pack 1!
Following on very nicely from my last post on deploying Silverlight content to your own production server, I'm pleased to announce that Silverlight Streaming has added full support for Silverlight 2 applications. As well as adding the basic support, the team have put a lot of work into simplifying the process of uploading and validating your application. Here's a basic walkthrough:
<SilverlightApp> <version>2.0</version> <source>PopTheBubble.xap</source> <width>400</width> <height>300</height> <background>white</background> <isWindowless>false</isWindowless> </SilverlightApp>
As a small example, here's a mini-game called PopTheBubble that you can learn to build by following the Silverlight 2 fundamentals hands-on lab. Click on as many bubbles as you can before the timer runs out - have fun!
Deploying Silverlight content to a production web server is a pretty easy process. Despite occasional misconception, Silverlight doesn't require a Microsoft-based web server: Apache can host up Silverlight content just as happily as IIS.
But there's one little gotcha: web servers are typically configured to only serve up a limited set of known file extensions as static content. That's all well and good, but Silverlight introduces two new file extensions (.xaml for loose XAML files and .xap for the zip-based binary packaging format). As a result, you need to add the MIME types for those file extensions to your web server so that it recognizes Silverlight content appropriately. Here are the MIME types you need to add to the server configuration:
That's all you have to do. Unfortunately, it's not possible to provide generic instructions for how to add MIME types, as it varies from server to server, but here are some links for various common web servers:
While you're updating the list of MIME types served, you might want to also add the relevant types to your web server to support WPF and ClickOnce applications. Here are the additional items you'll need:
But what if you're hosting your Silverlight application on a shared hosting service and your hoster doesn't give you access to change these settings? The good news is that there are two options available to you. Obviously, you could take advantage of Silverlight Streaming, our free hosting service for up to 10GB of Silverlight content.
Alternatively, you can "cheat" the web server by renaming the XAP file extension to a compatible MIME type. The XAP container is ZIP-based, so you can simply rename the output file from .xap to .zip and change the source param within the object tag contained in the HTML file to point to the new file location. Click on this hyperlink to see the technique in action - it's a plain HTML file that points to a ZIP file (containing the Silverlight content).
One last piece of good news: IIS 7, included in Windows Server 2008, already includes all the relevant MIME types for both WPF and Silverlight, including both .xap and .xaml extensions, so if you're using Windows Server 2008, you're all set. (The same applies to a clean install of Windows Vista SP1, although if you upgrade from the RTM to the SP1 release, your settings will remain unchanged until you uninstall and reinstall the IIS feature).
It can be pretty hard to keep everything up-to-date on a developer workstation these days. With so many CTP releases, betas, and service packs, I know I often realize that my own machine is behind in one area or another.
One particularly worthwhile update that might have missed your attention over the last couple of weeks is a new release of the Windows SDK, focused on enhancements in the .NET Framework 3.5, Windows Vista SP1 and Windows Server 2008. Amongst other changes, this updated SDK has new documentation that covers all the new classes in WPF 3.5 (e.g. UIElement3D, System.AddIn, LINQ-based data binding), a variety of new samples for common Windows services such as User Account Control, Windows Search, Windows Error Reporting, Speech, and a range of shell APIs. If you've not installed the Windows SDK before, another incentive is a ZIP file containing over 100MB of sample WPF code (check out %ProgramFiles%\Microsoft SDKs\Windows\v6.1\Samples\WPFSamples.zip).
After installing the Windows SDK, you'll want to do two things:
For more information on the Windows SDK, check out the team's blog or visit the recently overhauled Windows Vista development center on MSDN.