Skip to main content
 首页 » 编程设计

c#之开发 Microsoft Surface 2.0 应用程序时出现 InvalidOperatioException

2024年02月23日15leader

我正在使用 Visual C# 2010 Express Edition 开发 Microsoft Surface 2.0 应用程序。我已经在 Windows 7(32 位)上安装了 Surface 2.0 SDK 和运行时环境。

从已安装的模板中,我选择一个新的 Surface WPF 应用程序并按 F5。我收到一个包含以下消息的 InvalidOperationException -

Cannot load Counter Name data because an invalid index 'Terminal Services' was read from the registry.

该项目是空的。我还没有添加一行代码。同一个空白应用程序在另一个运行 Visual Studio 2010 Ultimate 的桌面上运行良好。

请您参考如下方法:

我会先在这里尝试:PerformanceCounters on .NET 4.0 & Windows 7

性能计数器很可能没有加载到注册表中,或者至少没有正确加载。我知道问题不同,但症状是一样的。