This documentation is archived and is not being maintained.

WebException Class

The exception that is thrown when an error occurs while accessing the network through a pluggable protocol.

For a list of all members of this type, see WebException Members.


[Visual Basic]
Public Class WebException
   Inherits InvalidOperationException
public class WebException : InvalidOperationException
public __gc class WebException : public InvalidOperationException
class WebException extends InvalidOperationException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The WebException class is thrown by classes descended from WebRequest and WebResponse that implement pluggable protocols for accessing the Internet.

When WebException is thrown by a descendant of the WebRequest class, the Response property provides the Internet response to the application.


Namespace: System.Net

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

See Also

WebException Members | System.Net Namespace | Exception