You receive a "NullReferenceException" error message or an "OutOfMemoryException" error message when you run the MultiThreaded TCP/IP Listener sample application in Visual Studio .NET (837222)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
SYMPTOMSIn Microsoft Visual Studio .NET, when you run the
application that is associated with the "Windows Forms: Multi-Threaded TCP/IP
Listener sample" Help topic, the Microsoft Windows Form that is named Client may
close unexpectedly and you may receive one or more of the following error
messages: Message 1 An unhandled exception of type
'System.NullReferenceException' occurred in Client.exe Additional
information: Object reference not set to an instance of an object. Message 2 An unhandled exception of type
'System.OutOfMemoryException' occurred in
system.windows.forms.dll Additional information: Too many items in list
box. Note If you are using Visual Studio .NET 2003, and you follow the instructions that
appear in the "To run this sample" section of the "Windows Forms:
Multi-Threaded TCP/IP Listener Sample" Help topic, this behavior does not occur because the Visual Studio .NET 2003 Help topic
contains the correct instructions to run the sample. CAUSEThe application that is associated with the "Windows Forms: Multi-Threaded TCP/IP
Listener sample" Help topic is a solution that contains multiple projects.
In Microsoft Visual Studio .NET 2003, this problem occurs because the startup
configuration for the projects is incorrectly set to Start instead of to Start
without debugging.
In Microsoft Visual Studio .NET 2002, this problem occurs because the startup
configuration for the solution is incorrectly set to Single Startup Project
instead of to Multiple Startup Projects.WORKAROUNDTo work around this problem, change the configuration
settings for your solution or for your projects. To do this, follow
these steps:
- In Visual Studio
.NET, open the TCPIPListener solution.
- In Solution Explorer, right-click the solution, and then click Properties. The
Solution 'TCPIPListener' Property Pages dialog box
appears.
- Click the Multiple Startup
Projects option.
- Under Project, click
Client.
- In the Action field of the Client project, click Start without
debugging.
- Under Project, click
Listener.
- In the Action field of the Listener project, click Start without
debugging.
- Click
OK.
- On the Debug menu, click Start
Without Debugging.
REFERENCESFor more information, visit the following Microsoft
Developer Network (MSDN) Web sites:
Modification Type: | Minor | Last Reviewed: | 3/4/2006 |
---|
Keywords: | kbvs2005swept kbvs2005doesnotapply kberrmsg kbProductSample kbDownload kbprb KB837222 kbAudDeveloper |
---|
|