C# Visual Studio在线程退出消息中打印线程名称

C# Visual Studio在线程退出消息中打印线程名称,c#,visual-studio-2013,C#,Visual Studio 2013,我试图在线程退出时进行调试,以便跟踪问题。Per,我已经给出了我的线程名称。但是,在Visual Studio中的退出消息上,它仍然不打印线程名称,只打印id,如下所示: 线程0x1ed4已退出,代码为259(0x103) 有没有一个设置或者我遗漏了什么?我在VS里到处找过,但似乎什么也找不到 也许我只是把它命名错了,所以这里有一个小例子来说明我所说的: class Program { static ManualResetEvent aThreadMre; static voi

我试图在线程退出时进行调试,以便跟踪问题。Per,我已经给出了我的线程名称。但是,在Visual Studio中的退出消息上,它仍然不打印线程名称,只打印id,如下所示:

线程0x1ed4已退出,代码为259(0x103)

有没有一个设置或者我遗漏了什么?我在VS里到处找过,但似乎什么也找不到

也许我只是把它命名错了,所以这里有一个小例子来说明我所说的:

class Program
{
    static ManualResetEvent aThreadMre;

    static void Main(string[] args)
    {
        aThreadMre = new ManualResetEvent(false);
        Thread aThread = new Thread(Process);
        aThread.Name = "a_thread";
        aThread.Start();

        /// ...
        Thread.Sleep(TimeSpan.FromSeconds(5));
        /// ...

        aThreadMre.Set();
        aThread.Join();
    }

    static void Process()
    {
        // Make sure the name was set
        Console.WriteLine(Thread.CurrentThread.Name);

        int counter = 0;
        while (true)
        {
            if (aThreadMre.WaitOne(TimeSpan.FromSeconds(1)))
            {
                break;
            }

            Console.WriteLine(++counter);
        }
    }
}

我怀疑这里的问题是本机(Win32)线程实际上没有名称;
Name
字段存在于.Net对象中。也就是说,这里有一个Visual Studio的示例。谢谢。我将尝试一下这种攻击。VS2015 RC在退出时自动显示托管线程名称,但RTM没有。调试器中的某些内容在两者之间发生了更改。