This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The exception that is thrown when a method call is invalid for the object's current state.
public ref class InvalidOperationException : Exceptionpublic ref class InvalidOperationException : SystemExceptionpublic class InvalidOperationException : Exceptionpublic class InvalidOperationException : SystemException[System.Serializable]public class InvalidOperationException : SystemException[System.Serializable][System.Runtime.InteropServices.ComVisible(true)]public class InvalidOperationException : SystemExceptiontype InvalidOperationException = class inherit Exceptiontype InvalidOperationException = class inherit SystemException[<System.Serializable>]type InvalidOperationException = class inherit SystemException[<System.Serializable>][<System.Runtime.InteropServices.ComVisible(true)>]type InvalidOperationException = class inherit SystemExceptionPublic Class InvalidOperationExceptionInherits ExceptionPublic Class InvalidOperationExceptionInherits SystemExceptionFor more information about this API, seeSupplemental API remarks for InvalidOperationException.
| Name | Description |
|---|---|
| InvalidOperationException() | Initializes a new instance of theInvalidOperationException class. |
| InvalidOperationException(SerializationInfo, StreamingContext) | Obsolete. Initializes a new instance of theInvalidOperationException class with serialized data. |
| InvalidOperationException(String, Exception) | Initializes a new instance of theInvalidOperationException class with a specified error message and a reference to the inner exception that is the cause of this exception. |
| InvalidOperationException(String) | Initializes a new instance of theInvalidOperationException class with a specified error message. |
| Name | Description |
|---|---|
| Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited fromException) |
| HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited fromException) |
| HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited fromException) |
| InnerException | Gets theException instance that caused the current exception. (Inherited fromException) |
| Message | Gets a message that describes the current exception. (Inherited fromException) |
| Source | Gets or sets the name of the application or the object that causes the error. (Inherited fromException) |
| StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited fromException) |
| TargetSite | Gets the method that throws the current exception. (Inherited fromException) |
| Name | Description |
|---|---|
| Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited fromObject) |
| GetBaseException() | When overridden in a derived class, returns theException that is the root cause of one or more subsequent exceptions. (Inherited fromException) |
| GetHashCode() | Serves as the default hash function. (Inherited fromObject) |
| GetObjectData(SerializationInfo, StreamingContext) | Obsolete. When overridden in a derived class, sets theSerializationInfo with information about the exception. (Inherited fromException) |
| GetType() | Gets the runtime type of the current instance. (Inherited fromException) |
| MemberwiseClone() | Creates a shallow copy of the currentObject. (Inherited fromObject) |
| ToString() | Creates and returns a string representation of the current exception. (Inherited fromException) |
| Name | Description |
|---|---|
| SerializeObjectState | Obsolete. Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited fromException) |
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?