I was directed to SuperUser from a question I posted on stack overflow.
Link to StackOverflow question: New Instance of TCPClient Exception
While creating an application on Visual Studios 2013 professional on a windows 7 machine using C# WinForms, I came across an exception. The Exception reads:
An invalid argument was supplied.
I even used a simple Console Application to demonstrate the issue. The line of code that creates the issue is as follows:
TcpClient tcpClient = new TcpClient();
The stack trace that I get for this is as follows:
"at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)\r\n at System.Net.Sockets.TcpClient.initialize()\r\n at System.Net.Sockets.TcpClient..ctor(AddressFamily family)\r\n at System.Net.Sockets.TcpClient..ctor()\r\n at ConnectLite.ConnectLite.MakeConnection() in h:\Howard\Projects\ConnectLite\ConnectLite\Form1.cs:line 120"
More about the issue:
This exception/error only happens on my workstation/computer. When running this application that I have created on other computers, one with and one without VisualStudios '13, I do not receive the error/exception and the application gets further into the code.
My assumption is that there is some sort of internal corruption, error, or bug. Someone on StackOverflow suggested that there might be an issue with the .NET framework. I really have no idea. I have finally reached the assumption that the issue does not lie with the coding/C#. Others on StackOverflow have ran my simple console application (all that is in the console app is the single line declaring a new TcpClient). Upon doing this, the others on StackOverflow did not receive any errors or exceptions.
Does anyone have any ideas about this issue?
I will be monitoring this feed regularly. All questions, tips, hints, and answers are welcome.