Reputation: 2928
Given the following code,
Process Proc=null;
ProcessStartInfo DirectX=new ProcessStartInfo("dxsetup.exe", "/silent");
DirectX.WorkingDirectory="Tools\\directx";
Proc=Process.Start(DirectX);
I get The thread '<No Name>' (0x1eec) has exited with code 0 (0x0).
in the output window of Visual Studio upon termination of the process.
I would like to change the text "No Name"
to something descriptive, yet all I find online is for Thread.Name
which doesn't seem to work for Process
objects.
Can someone point me in the right direction?
Building with C# .NET 4.0 in Visual Studio 2010. Running on Windows 7 64 bit.
Upvotes: 0
Views: 4519
Reputation: 941455
There are always plenty of threads running in your program that you didn't directly start yourself. Like the threads in the .NET threadpool, the native Windows threadpool and the RPC threadpool, you'll see them exiting when the pool manager trims the pool. The Process class itself uses tp threads, that's how the Exited event is raised for example.
You cannot name them, you didn't start them and there's no way to get a reference to such a thread. Naming a threadpool thread is possible if it runs your code but it is a hack.
The easiest way to cut down on the noise is to right-click the Output window while you are debugging and untick "Thread Exit Messages".
Upvotes: 7