I am developing a Microsoft Surface 2开发者_如何学编程.0 application using Visual C# 2010 Express Edition. I have already installed the Surface 2.0 SDK and Runtime Environment on a Windows 7 (32 bit).
From the installed templates, I choose a new Surface WPF application and press F5. I get an InvalidOperationException
with the following message -
Cannot load Counter Name data because an invalid index 'Terminal Services' was read from the registry.
The project is empty. I haven't added a single line of code yet. The same blank application works perfectly well on another desktop running Visual Studio 2010 Ultimate.
I would try here first: PerformanceCounters on .NET 4.0 & Windows 7
Most likely the performance counters are not loading in the registry, or at least not loaded properly. I know the question is different, but the symptoms are the same.
Run lodctr.exe /r
it will repair registry entries related to the perfmon counters.
精彩评论