该请求的性能计数器不是自定义计数器,它必须进行初始化为只读 [英] The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly

查看:625
本文介绍了该请求的性能计数器不是自定义计数器,它必须进行初始化为只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到有关性能计数器的只读属性重复错误,每当我尝试调试一个.NET Windows服务的应用程序。这个应用程序正常工作在x86 Windows Vista或x86的Windows 2003上它只是停止工作对我的新的64位开发机。

I am getting repeated errors about the ReadOnly property on performance counters whenever I try to debug a .NET windows service app. This app works fine on x86 windows vista, or x86 windows 2003. It's just stopped working on my new 64bit dev machine.

我已经运行有关InstallUtil在64位和32位的命令行了vcvars.bat调用,在管理模式。我得到的没有错误设置的类别和各个性能计数器。但是,不管我设置PERF点击率为只读或没有,我得到这样的:

I've run the relevant InstallUtil invocations on 64bit and 32bit command line VCVARS.bat, in admin mode. I get no errors setting up the category and each perf counter. But, regardless of whether I set the perf ctrs as readonly or not, I get this:

该请求的性能计数器   不是自定义计数器,它必须   初始化为只读。

The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.

更新

我重新安装了Windows 7的32位版本的机器,而奇怪的是我仍然得到这个错误。已更改的唯一的事情是从Windows Vista商业版迁移至Windows 7专业版。这是否环任何钟声?

I re-installed the machine with a 32bit version of Windows 7, and bizarrely I still get this error. The only thing that has changed is moving from Windows Vista Business to Windows 7 Professional. Does this ring any bells?

推荐答案

这是由于性能计数器(或类别)的不存在,  但有一个可怕的错误消息。

This is due to the performance counter (or category) not existing, but with a horrible error message.

拿计数器在性能监视器一看,应该缺少相关的机器。

Take a look in perfmon for the counter, it should be missing on the relevant machines.

我觉得发生这种情况,有时净PERF的计数器(不知道为什么),但使用LODCTR 1 让他们回来。如果您指示哪个性能计数器你想要知道的,我们也许能够给你更多的帮助。

I find this happens to the .Net perf counters sometimes (no idea why) but using lodctr1 gets them back. If you indicate which perf counter you are trying to get at we might be able to give you more help.

  1. 需要注意的是林立的例子是对于.NET 1.1,调整不同的框架相应。

这篇关于该请求的性能计数器不是自定义计数器,它必须进行初始化为只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆