| Comments

Each release of Silverlight it is the goal to make sure existing Silverlight applications continue to work.  Since I think what this means causes some confusion I’m going to do my best to explain what we mean by this.

Silverlight 3 application working with Silverlight 4

Okay, scenario 1 is I have a Silverlight 3 application (XAP), will that still work as-is in Silverlight 4? 

Yes, this is the situation we refer to as backward compatibility.  What this means is that existing compiled XAPs under previous versions should continue to work as-is even if your users have a later version of Silverlight installed on their machine. 

An example would be someone like Netflix.  If you are already a Netflix instant watch user with their Silverlight application, then you’ve been watching movies fine on your computer for a while.  If you go and download Silverlight 4 today, this should not change, even though their player is Silverlight 3.  From the docs:

The Silverlight team wanted to fix a number of Silverlight 3 bugs in Silverlight 4. However, by fixing some of these bugs, it is possible that some existing Silverlight 3 applications would break. In order to avoid this, the Silverlight team addressed these potentially problematic changes by creating a "quirks mode" for runtime behavior. A quirks mode change is a case where the Silverlight 4 runtime will branch its behavior if the runtime detects that the application is targeting Silverlight 3. In this way, Silverlight 4 is made "bug compatible" as a runtime. However, the noted quirks mode behavior may need to be revisited if you recompile your application for Silverlight 4.

The above scenario (previous version Silverlight apps running under their version mode) is often referred to as “quirks mode.”

Silverlight 3 CODE recompiled as Silverlight 4 app

Next scenario is I opened my Silverlight 3 code project and compiled as Silverlight 4 and now it doesn’t work!?  You said backward compatible!!!

This is where breaking changes come into play.  Breaking changes range from anything from security fixes to bug fixes to correcting behavior that we wanted to change.  We try at all costs to avoid breaking changes, but sometimes they are unavoidable to progress and make things right.  When we can’t avoid them, we do our best to ensure that quirks mode (described above) works as customers expect.

For Silverlight 4, there are some breaking changes from 3->4 that developers should be aware of.  These are all documented on MSDN here.  Here is a point list of a few of them:

  • XAML Parsing AmbiguousMatchException when application property conflicts with new Silverlight 4 property
  • Toggling full screen mode reruns hit testing
  • Shared BitmapImage resources
  • DRM on cients with FAT32

The document explains the scenarios as well as what to do, if applicable. 

Hopefully this helps understand a few things.  If you find that your compiled Silverlight 3 XAP is not running correctly when rendered in a Silverlight 4 plugin environment, please let us know on the forums with as much detail as possible (i.e., “it doesn’t work” isn’t enough).


| Comments

Yet again, we’ve updated the Silverlight Client for Facebook for the Silverlight 4 release version.  In order to use the updated one, you must follow these instructions:

  • First, uninstall the previous version you have.  This can be done in Add/Remove Programs on Windows or by just deleting the app on Mac.
  • Ensure you have Silverlight 4 installed.  If you are using the development tools and have installed Silverlight 4 developer tools, that’s fine.  If you are not a developer, visit http://microsoft.com/getsilverlight to get the latest Silverlight 4 version (4.0.50401.0).
  • After you have Silverlight 4 installed, visit the app page and install it.

You should be good after this! 

So why so many uninstall/re-installs!?  I thought you had an auto-update mechanism!

We do!  With Silverlight 4 trusted applications, the update mechanism requires that your applications be signed in order to use the auto-update APIs.  We wanted to wait until SL4 released in order to provide a signed version (and our internal signing process didn’t allow signing the beta).  Now that we have a signed version, you’ll be prompted when an update has been installed for the app.  For more details on signing your Silverlight applications see:

Hope this helps!

| Comments

Today’s the day!  Tuesday at DevConnections in Las Vegas, Scott Guthrie just announced the ‘launch’ of Silverlight 4.  We wanted to take the opportunity at DevConnections to let a large audience of our customers online/offline know that we’re done and shipped Silverlight 4.  As of today it’s now available for you to download/use.  Here’s some helpful quick update information for you:

What’s New in Silverlight 4?

Rather than cut/paste what I’ve already said here, I recommend the following reading:

These two posts are full of detailed information with links to tutorials and videos to help you get started.  Since the RC (which was released middle March), not much has changed from an API perspective so you should be good to go getting started using the above information.  One thing that has changed in the tools is that for XAP signing, there is a UI support for enabling the tool to help you select a certificate, etc.  You can still use my post-build method though.

Downloading Silverlight 4

The availability of Silverlight 4 will be approximately 10:00 AM PST on Thursday 15 April 2010.  I suggest you prep now by getting the Visual Studio 2010 release that was launched/available yesterday.

The goods:

That’s my own personal minimum list.  VS and SL4 tools are the minimum required to get started doing development.

Wait, what’s this RC stuff?

To be clear, Silverlight 4 has released.  This is RTW (release to web).  It is the version 4 of Silverlight.  Shipped.  Done.  Finished.

The tools (namely SL4 tools, RIA Services and Blend) are in their ‘release candidate’ mode.  I’ll spare you the gory details, but remember that these tools teams need SL4 to be *done* before they can be done.  SL4 is a dependency for them.  These tools are release quality though and I’d recommend using them.  Their final versions will come soon enough and will be a minor update.

What about RIA Services?!  You don’t consider that to be valuable?!

Actually I do.  But if you’ve installed the Silverlight 4 Tools, then you already have it!

This seems to be some confusion to many and perhaps because of how we present the information in an effort to be complete.  If you are a developer, install Silverlight 4 Tools.  After this installation completes you will have:

  • Silverlight 4 developer runtime
  • Silverlight 4 SDK
  • Visual Studio patch, debug tools and project templates
  • WCF RIA Services RC

installed.  No need to run the SDK or RIA Services installers separately.  Adding the Silverlight Toolkit to this provides you with more controls to leverage in your applications as well (charting, ContextMenu, etc.).

Hey, what about the Windows Phone 7 developer tools?

If you need to continue doing Windows Phone 7 development, stick with the Visual Studio 2010 Release Candidate for now!  The updated CTP of the Windows Phone developer tools is not quite done yet.  Information about updated tools availability will be forthcoming on these tools.  Stay tuned.

Can I keep VS2008 and VS2010 on the same machine?

Yes you can.  Visual Studio 2008 and 2010 can co-exist on the same machine.  Obviously there are some differences to what the tools can do with regard to Silverlight.  There are two distinct differences I like to call out:

  • VS2008 cannot be used for Silverlight 4 development.
  • You can only have one version of WCF RIA Services installed on the machine.

For the latter, you may be asking “huh?”  There is a version of RIA Services for VS2008.  There is also a version for VS2010.  Unfortunately RIA Services cannot co-exist in two versions.  You have to pick one.  And the VS2008 one is only for SL3 and only supported until December this year.  I recommend moving on from that…it’s not going to be developed any more…essentially the PDC09 version was the last revision there.

Other resources

If you need other resources, be sure to check the Silverlight Community Site for details on things like the stand-alone documentation file, Mac platform developer build (for debugging if needed) and other resources.  Be sure to check out the Silverlight 4 videos if you haven’t yet as well!  I’ve gotten a few questions so I’ll emit some resources here:

Hope this helps find things easier.

What about the future versions…

Man, give us a break!!!  But seriously make your opinion known on http://silverlight.mswish.net for features.  Be specifically broad ;-).  What I mean is “Fix Printing” doesn’t help, but “Enable automatic paging in printing” is better.

Hope this helps!


| Comments

I recently got an inquiry to my Microsoft Translator sample on if this would work with the Silverlight in the Windows Phone 7 SDK.  I hadn’t tried it before, so I created a sample Windows Phone 7 application and copied the code over.  I used a basic UI to mock up the similarities:

Translator phone sample screenshot

And then clicked the button.  The text translated fine, but no audio.  I didn’t get any warnings that the WaveMSS code sample I was using wouldn’t work.  Then I remembered about XNA.

NOTE: I actually think this is a bug in PCM audio and MediaStreamSource and have been having a dialog with the team about it.

In Windows Phone 7 your Silverlight applications can use some XNA Game Framework APIs.  A big component of games is audio!  Enter SoundEffect.  I added a reference to Microsoft.Xna.Frameowkr and changed my OnSpeakCompleted from:

   1: void OnSpeakCompleted(object sender, TimHeuer.Silverlight.SpeakCompletedEventArgs e)
   2: {
   3:     WaveMSS.WaveMediaStreamSource mss = new WaveMSS.WaveMediaStreamSource(e.AudioTranslation);
   4:     PlayMe.SetSource(mss);
   5: }

to:

   1: void OnSpeakCompleted(object sender, TimHeuer.Silverlight.SpeakCompletedEventArgs e)
   2: {
   3:     SoundEffect se = SoundEffect.FromStream(e.AudioTranslation);
   4:     se.Play();
   5: }

Notice it is still 2 lines of code :-).  I don’t need a MediaElement for the audio palyback because I can use the same libraries that XNA uses for audio (and in some instances this will be better for you for looping audio, etc.).

Very cool that Silverlight and XNA can share some libraries in a single application!

| Comments

Next week on 13-April at 8:00 AM PST Scott Guthrie will deliver a keynote address for the DevConnections conference being held in Las Vegas, NV.  Scott will provide updates on the progress made in Silverlight 4 and will provide the details of availability of the developer tools, runtime and other news.

Mark your calendars and return to the Silverlight community site to tune into the LIVE event.  After the keynote, Channel 9 will be hosting interviews with Scott and other key members of the Silverlight and Expression teams.  I’ll be hosting one of those interviews as well and look forward to your submitted questions via Twitter to @ch9live.