Share via


IsVersionSupported

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Determines whether the existing Silverlight plug-in matches or is compatible with a specified version string.

retval = silverlightObject.IsVersionSupported(versionString)

Arguments

versionString

string

A string that represents the version to check against the Silverlight plug-in.

Return Value

Type: Boolean

true if the existing Silverlight plug-in matches or is compatible with the specified version string; otherwise, false.

Managed Equivalent

SilverlightHost.IsVersionSupported although note that you need an Application object and thus a running Silverlight application in order to call SilverlightHost.IsVersionSupported.

Remarks

The versionString parameter contains four integer values that are separated by dots, following the format: major.minor.build.revision (for example, "1.0.50232.0"). The sequence of integers represent the following Silverlight version values:

  • The major version number.

  • The minor version number.

  • The build number.

  • The revision number.

This method primarily supports the JavaScript helper method IsInstalled, which is defined in Silverlight.js. The main reason you typically need to know the installed Silverlight version is to change the information that is displayed to the user before you instantiate a Silverlight plug-in instance with content on your HTML page, and to anticipate whether your users will see the Silverlight update or installation dialog box. When you have an instantiated Silverlight plug-in that is already displaying content, checking the installed version is of lesser importance.

Applies To

Silverlight Plug-in