System.Core 3.5.0.0 System.Exception

This exception is thrown by the and methods when a time zone identifier cannot be found on the local system, or when there is no data associated with a particular time zone identifier.

Because the registry serves as the repository of time zone information in Windows XP and Windows Vista, this exception indicates that the registry contains no information about a particular time zone. Time zone information is stored in the subkeys of HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones.

If an application depends on the presence of a particular time zone and the attempt to retrieve it throws a , the application can handle the exception in either of two ways:

By calling the method to deserialize a saved object.

By calling one of the overloads of the method to create a time zone.

See the examples for the and methods.

The exception that is thrown when a time zone cannot be found.

- Constructor
  3.5.0.0

  This is the default constructor of the class. This constructor initializes the property of the new instance to a system-supplied message that describes the error, such as "The time zone 'timeZoneName' was not found on the local computer." This message is localized for the current system culture.

  Initializes a new instance of the class with a system-supplied message.

- Constructor
  3.5.0.0

  The string is assigned to the property. The string should be localized for the current culture.

  Initializes a new instance of the class with the specified message string.

  A string that describes the exception.
- Constructor
  3.5.0.0
  To be added.

  This constructor is not called directly by your code to instantiate the object. Instead, it is called by the object's method when deserializing the object from a stream.

  Initializes a new instance of the class from serialized data.

  The object that contains the serialized data.
- Constructor
  3.5.0.0
  To be added.

  Typically, you use this overload to handle an exception in a try…catch block. The parameter should be a reference to the exception object handled in the catch block, or it can be null. This value is then assigned to the object's property.

  The string is assigned to the property. The string should be localized for the current culture.

  Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.

  A string that describes the exception.