p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional C#, 2nd and 3rd Editions (http://p2p.wrox.com/forumdisplay.php?f=44)
-   -   Issues about PerformanceCounter (Chapter 22) (http://p2p.wrox.com/showthread.php?t=14256)

newmike June 15th, 2004 10:10 PM

Issues about PerformanceCounter (Chapter 22)
 
Hi, all,

After I install the example code for performanceCounter (WinServices\QuoteService), the installation is done successfully, but the Window service "QuoteService" can not be startup, an error event is follows:
================================================== ===============
Event Type: Error
Event Source: QuoteService
Event Category: None
Event ID: 0
Date: 16/06/2004
Time: 2:49:42 p.m.
User: N/A
Computer: FREECITY-HOME
Description:
The description for Event ID ( 0 ) in Source ( QuoteService ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: [u]Service cannot be started. System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.</u>
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter.EndInit()
at Wrox.ProCSharp.WinServices.QuoteServer.InitializeC omponent()
at Wrox.ProCSharp.WinServices.QuoteServer..ctor(Strin g filename, Int32 port)
at Wrox.ProCSharp.WinServices.QuoteService.OnStart(St ring[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMai nCallback(Object state).
================================================== ===============

It looks like the way to setting an writable performance counter object is wrong. I did check some web page, did not find solution for this issue yet. Anyone has some idea for this issue?

BTW, My machine is Windows XP Pro + DotNet v1.1 + VS 2003, Thanks.


All times are GMT -4. The time now is 05:48 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.