Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Silverlight 2
 Silverlight Versioning

  Switch on low bandwidth view
Silverlight
Silverlight Versioning

Updated: November 2008

To run a Silverlight-based application within a Web page, users must have the correct version of the Silverlight plug-in installed. Depending on how you embed the plug-in, you can specify the version that your Web page requires in one of two ways:

  • With the HTML object element.

  • With the Silverlight.js helper functions.

With both options, you can prompt users to install the correct version if it is not already installed.

You can also specify a required Silverlight runtime version in the manifest of your application assembly. For more information, see Deployment..::.RuntimeVersion.

With the object element, you specify the required Silverlight version by including a type attribute and setting the value to a Silverlight MIME type. Each major release has its own MIME type, as indicated in the table at the end of this topic.

If a Silverlight plug-in version with the specified MIME type is not installed, the HTML content of the object element is shown instead. You can use this to provide an installation link. For more information, see How to: Add Silverlight to a Web Page by Using HTML.

You can optionally specify a MinRuntimeVersion value in the form majorVersion.minorVersion.buildNumber.revisionNumber, where all values are optional except majorVersion. In this case, if a user has an earlier version of the plug-in installed, the plug-in will not load the application package. Instead, it will display the message "Click to install the required version". This prevents malicious applications from exploiting bugs in earlier versions of Silverlight that are fixed in more recent versions. If your plug-in size is too small to display the default message, you should prompt the user to upgrade, as described in the following text.

If you specify a MinRuntimeVersion value, you can optionally specify an AutoUpgrade value. If an upgrade is required and you set AutoUpgrade to true, the plug-in will prompt the user to upgrade and then to restart the Web browser. The upgrade prompt is displayed in addition to the default message that appears in the plug-in.

If an upgrade is required, the following errors occur, regardless of the AutoUpgrade setting:

  • 8001 - Upgrade required.

  • 8002 - Browser restart required.

You can respond to these errors in an OnError handler in order to display your own upgrade and browser restart prompts. In this case, however, you typically do not set AutoUpgrade to true.

For more information about handling errors with the errors in an OnError event, see Error Handling and Error Messages.

With the Silverlight.js helper functions, you specify a Silverlight version number in the form majorVersion.minorVersion.buildNumber.revisionNumber where all values are optional except majorVersion. Version numbers are used by the following functions:

  • isInstalled. This function accepts a version parameter and indicates whether that version of Silverlight is installed.

  • createObject and createObjectEx. These functions accept a version value in the properties parameter array. If the specified version of Silverlight is installed, the plug-in is embedded in the Web page. Otherwise, these functions display alternative HTML.

  • getSilverlight. This function accepts a version parameter and attempts to download the corresponding Silverlight installer.

You can use these and other Silverlight.js functions to embed the Silverlight plug-in and customize the installation and upgrade experience. For more information, see How to: Add Silverlight to a Web Page by Using JavaScript and Silverlight.js Reference.

The following table lists the MIME type and version number associated with each major version of the Silverlight plug-in. Silverlight 2 is backward compatible with Silverlight 1.0. If you specify that your application requires Silverlight 1.0, then your application will run in Silverlight 2, but it will only be able to use the JavaScript API. For more information, see Application and Programming Models.

Version

MIME Type

Version Number

Installer URL

Silverlight 1.0

application/x-silverlight

1.0

http://go.microsoft.com/fwlink/?LinkId=110408

Silverlight 2

application/x-silverlight-2

2.0.31005

http://go.microsoft.com/fwlink/?LinkID=124807

NoteNote:

The beta releases of Silverlight 2 use the same major and minor version numbers (that is, 2.0) as the final release. Therefore, you should always include the build number (that is, 31005) to indicate the Silverlight 2 final release.

The installer URLs redirect to the appropriate installer or error message depending on the user's platform and browser. For example, the Silverlight 1.0 installer URL redirects to the Silverlight 2 installer except on platforms that do not support Silverlight or support Silverlight 1.0 only.

Date

History

Reason

November 2008

Updated the Silverlight 2 final version number, added installer URLs, and clarified the relationship between the current release and earlier releases.

Information enhancement.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker