Introducing Microsoft Silverlight 1.1 Alpha [Justin Van Patten]

Today at MIX07 we announced the availability of Microsoft Silverlight 1.1 Alpha, a cross-browser, cross-platform plug-in for delivering the next generation of .NET-based media experiences and rich interactive applications for the Web.  Silverlight is supported on Firefox and Safari on Mac OS X and on Firefox and Internet Explorer on Windows.

Silverlight 1.1 Alpha includes all the features available in Silverlight 1.0 Beta plus a number of new features focused primarily on improving developer productivity and power:

  • Managed code support
  • Support for dynamic languages including Managed JScript and Python
  • Rich UI control model based on WPF
  • Improved networking stack with support for REST, RSS, JSON, POX
  • Enhanced, 2-way HTML/AJAX Bridge
  • Comprehensive and consistent base class library
  • Support for LINQ (LINQ to Objects, LINQ to XML)

That's right.  Silverlight 1.1 Alpha includes support for managed code and a comprehensive base class library!  Now you know what we've been up to and why our blog has been relatively quiet these past several months :-)

Our partner .NET teams within Microsoft have been able to provide an amazing amount of additional functionality on top of the Silverlight 1.1 BCL.  There's a networking stack, XmlReader and XmlWriter, an HTML/AJAX Bridge, a WPF API subset, a safe OpenFileDialog control, LINQ, and the new Dynamic Language Runtime (DLR).  What's really exciting is that all of these APIs are cross platform and work consistently on both Mac OS X and Windows!

You can download Silverlight 1.1 Alpha today along with the SDK at http://msdn.microsoft.com/silverlight.  After you've downloaded the bits, check out the newly launched Silverlight community site.  It's a great resource for getting started with Silverlight.

Reduced Surface Area

The Silverlight 1.1 Alpha BCL is a subset of the .NET Framework 3.5 BCL.  The API surface area is loosely based on the .NET Compact Framework surface area with some differences.

For example, the Compact Framework supports encodings such as UTF-8, UTF-16 (Unicode), ASCII, and UTF-7, whereas Silverlight only supports UTF-8 and UTF-16 (Unicode).

The attached text file has a full listing of public types included in the Silverlight 1.1 Alpha BCL.  Note: The types and behavior exposed in Silverlight 1.1 Alpha is not yet final and will very likely change by RTM.

New Security Model

Silverlight 1.1 only supports partial trust applications.  In addition, a simple attribute-based security model has replaced Code Access Security (CAS) in Silverlight.

The new Silverlight security model consists of three access levels: Transparent, SafeCritical, and Critical.  Transparent code has the least privilege (partial trust) and SafeCritical and Critical have the most privilege (full trust).  Only assemblies trusted by Microsoft may elevate to full trust.  These assemblies, called "Platform code", must be signed with the Microsoft public key and reside in a trusted location.  All other code targeting Silverlight is referred to as "User code", and cannot elevate to full trust.

User code is only able to access Transparent and SafeCritical functionality.  If User code tries to access a Critical API, a MethodAccessException is thrown.

The APIs in the BCL are decorated with Security attributes to restrict access to privileged functionality.

An example of a Critical API in the BCL is the Delete method on System.IO.File.  It is marked SecurityCritical to prevent User code from deleting files on the file system.  Many of the File IO APIs are Critical.

Be mindful of this when you are developing your Silverlight applications.  Your code cannot call any APIs marked SecurityCritical; it can only call Transparent APIs (which typically have no security attribute) or APIs marked SecuritySafeCritical.

Update: Shawn Farkas has added two blog posts on the .Net Security Blog that discuss the new Silverlight security model in more detail.

We want to hear from you!

We'd love to hear your feedback on the Silverlight 1.1 Alpha release.  Have we provided the right base classes in Silverlight?  Is there something missing that you can't live without?  Is there something we should remove from Silverlight (and deprecate in the larger platform going forward)?  Let us know!

Leave your feedback and questions on the Silverlight forums:

We look forward to seeing your feedback and the rich Web apps you're able to create with Silverlight!  Download the bits, join the community, and start to play!

Keep an eye on the BCL Team Blog for more blog posts about Silverlight in the coming weeks. The next post will be about known issues in the Silverlight 1.1 Alpha BCL.

Silverlight1.1AlphaBCL.txt