English 中文(简体)
腐败的履约柜台?
原标题:corrupted performance counters?

性能计数器是EVIL,不要使用它们。

if(PerformanceCounterCategory.Exists("ILoveYou")  ) // is true
{
    PerformanceCounterCategory.Delete("ILoveYou"); 
    //throws exception The **configuration registry** key is invalid
}

at System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister)
at System.Diagnostics.PerformanceCounterLib.UnregisterCategory(String categoryName)
at System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName)
at WindowsFormsApplication1.Program.SetupCategory()

All I found is this: http://blogs.msdn.com/b/oanapl/archive/2009/04/24/fix-corrupted-performance-counters.aspx (Using LODCTR /R)

因为我不知道他们在谈论什么文件 有人有其他想法吗?

PS I use Windows XP SP3 may this be the problem? I understand it is suppose to support performance counters fully unless I cancel the page file.

说清楚我的问题是,我无法使用我的柜台。 /强。

最佳回答

My company runs into problems with the performance counters getting corrupt regularly. If it is a problem with the actual counters being corrupt, you can check for corrupted Performance Counters by:

  1. Going to start | run | perfmon
  2. Click OK
  3. Click on the add button on the toolbar in the right panel ("+" sign button)
  4. Ensure that the proformance object drop down menu contains items and not just numbers
If the Counters are numbers or Blank:
  • Locate and Rename these 3 files in %windir%system32:
    • Perfc009.dat
    • Perfh009.dat
    • Perfi009.dat
  • Insert the Windows XP Install CD
  • Browse to their CD drive and into the I386 Folder (i.e. D:I386)
  • Locate those same files here
  • Copy and Paste them from the CD back into System32
  • Reboot the computer.
  • 这是我们为该问题找到的最佳解决办法。

    问题回答

    如果您有类似的机器, 您可以运行 lodctr / S:mycounters.ini, 将所有反面都导出到我的反面。 ini, 然后将它们导入到一台带有 lodctr / R:mycounts. ini 的破损机器上。 但是, 记住, 我仅在两台机器上使用过这个程序, 据我所知, 这两台机器在perf 计数器上几乎完全相同。 我不知道是否与机器不匹配 。





    相关问题
    Anyone feel like passing it forward?

    I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

    NSArray s, Primitive types and Boxing Oh My!

    I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

    C# Marshal / Pinvoke CBitmap?

    I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

    How to Use Ghostscript DLL to convert PDF to PDF/A

    How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

    Linqy no matchy

    Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

    热门标签