
Versioning with the HTML Object Element
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:
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.