Monday, February 8, 2010

The operation has timed - Out System.TypeInitializationException asp.net web service Ip address class

In visual studio when trying add web reference to a web service you may receive the following error message

There was an error downloading 'http://WebServerName/WebServicePath/WebServiceName'. The operation has timed-out.


Or when using ipaddress class will receive a TypeInitializationException

Unhandled Exception: System.TypeInitializationException: The type initializer for "System.Net.Sockets.Socket" threw an exception. ---> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full at System.Net.Sockets.Socket.InitializeSockets() at System.Net.Sockets.Socket..cctor()


The reason for this error is

When you install a protocol or a network adapter on your computer, the operating system creates a protocol binding between the network adapters and the protocols that are installed on your computer. Typically, a computer can store up to 50 protocol binding details. Therefore, if the number of protocol bindings exceeds 50, and you use the IPAddress class directly or indirectly (such as when you try to add a Web reference or when you call a Web service method), you receive the error messages that are mentioned in the "Symptoms" section of this article.


To resolve this problem you must reduce the number of protocols binding on your computer to less than 50. Follow the following steps

1. Start->Settings-> Network and Dial-up Connections and right click any existing connection

2. Properties-> Select an unused protocol select uninstall

3. Click on yes to the propmpt

No comments:

Post a Comment