Share via


Silverlight Error Messages

This topic provides error message tables associated with Microsoft Silverlight error events.

It contains the following sections:

  • OnError Event Error Table
  • MediaFailed Event Error Table
  • ImageFailed Event Error Table
  • DownloadFailed Event Error Table

OnError Event Error Table

The following errors might be returned by the OnError event.

ErrorMessage ErrorType ErrorCode Description
AG_E_UNKNOWN_ERROR ANY 1001 The default error code that is bubbled up if no other specific error message is available. This error can apply to any call.
AG_E_INIT_CALLBACK initializeError 2100 Error in callback to the host script engine. This error occurs on initialization of the plug-in instance.
AG_E_INIT_ROOTVISUAL initializeError 2101 Error in visual root of the XAML tree. For example, you would get this error if the XAML root element is not a Canvas. Can also be raised if there are storyboard mismatches, such as referencing a Storyboard.TargetProperty that is not supported by the object that is the Storyboard.TargetName. This error occurs on initialization of the plug-in instance.
AG_E_RUNTIME_INVALID_CALL runtimeError 2201 Error returned when the particular call is not supported on that element. This error applies to all elements.
AG_E_RUNTIME_FINDNAME runtimeError 2202 The call to the FindName method failed. This applies to any element that FindName is supposed to find but cannot.
AG_E_RUNTIME_SETVALUE runtimeError 2203 Failure to set the value of a property. This applies both to standard JavaScript dotted property syntax, and to SetValue method calls.
AG_E_RUNTIME_GETVALUE runtimeError 2204 Failure to get the value of a property. This applies both to standard JavaScript dotted property syntax, and to GetValue method calls.
AG_E_RUNTIME_ADDEVENT runtimeError 2205 The AddEventListener method failed.
AG_E_RUNTIME_DELEVENT runtimeError 2206 The RemoveEventListener method failed.
AG_E_RUNTIME_METHOD runtimeError 2207 Error in a run-time method that does not have a specific error message. In a try/catch error object, the name of the method is appended to the string (for example, "AG_E_RUNTIME_METHOD : createFromXAML").
AG_E_RUNTIME_GETHOST runtimeError 2208 Error in getting the host object. This applies to the GetHost method.
AG_E_RUNTIME_GETPARENT runtimeError 2209 Error in getting the parent of an object. This applies to the GetParent method. Note that only Canvas objects can be parents of other objects.
AG_E_INVALID_ARGUMENT runtimeError 2210 An invalid argument has been passed.
AG_E_UNNAMED_RESOURCE runtimeError 2211 Error raised when an unnamed Storyboard is added to the Resources section of a UIElement.
AG_E_UNABLE_TO_PLAY mediaError 3000 See the MediaFailed table.
AG_E_INVALID_FILE_FORMAT MediaError, imageError, downloadError 3001 See the MediaFailed table and the ImageFailed table.
AG_E_NOT_FOUND MediaError, imageError 3002 See the MediaFailed table and the ImageFailed table.
AG_E_ABORT_FAILED downloadError 4000 See the DownloadFailed table. This error applies to the Downloader object.
AG_E_CONNECTION_ERROR downloadError 4001 See the DownloadFailed table. This error applies to the Downloader object.
AG_E_NETWORK_ERROR downloadError 4002 See the DownloadFailed table. This error applies to the Downloader object.

MediaFailed Event Error Table

The following errors might be returned by the MediaFailed event.

ErrorMessage Description
AG_E_NETWORK_ERROR Error raised when attempting to play back a non-existent or invalid media file from a third-party domain.
AG_E_INVALID_FILE_FORMAT This error can be raised for the following reasons:
  • When the media file is encoded in an unsupported codec.
  • When an unsupported format is set as MediaElement.source.
AG_E_NOT_FOUND The player will return this error from a call to GetMediaItem or GetMediaStreamItem (the native Windows Media APIs) if the media element asks for an item whose GUID is not recognized, or if the file does not exist at the URL specified.

ImageFailed Event Error Table

The following errors might be returned by the ImageFailed Event.

ErrorMessage Description
AG_E_INVALID_FILE_FORMAT (Same-domain only) The file indicated by the URI is not supported on this type of element. For example, this error might occur if you pass a .wmv file URI to ImageSource. This error is reported only if the source is not cross-domain.
AG_E_NOT_FOUND (Same-domain only) The file indicated by the URI was not found at the position indicated by the URI. This error is reported only if the source is not cross-domain.
AG_E_NETWORK_ERROR Error reported for any cross-domain errors, to prevent anyone who is calling Silverlight APIs from discovering the existence (or nonexistence) of files on third-party servers.

DownloadFailed Event Error Table

The following errors might be returned by the DownloadFailed Event.

ErrorMessage Description
AG_E_ABORT_FAILED Error raised when a call to Abort failed for some reason and the connection is still in progress.
AG_E_CONNECTION_ERROR Error raised from a call to Send. This error occurs before accessing the server when a failure to connect to the Internet occurs on the client side.
AG_E_NETWORK_ERROR Error resulting from a call to Send when the error has occurred on the server side. This error can also occur if you implicitly or explicitly attempt to use the Downloader to download a file: scheme URI.

See Also

Error Handling in Silverlight-based Scripting Applications
Overviews and How-to Topics