I have a .Net web service (written for 1.1 Framework using C#) running on
Windows 2003 with all latest patches. To help monitor the service, the code
creates several performance counters. One server (this is a farm) I receive
the following exception when trying to create the performance counters. We
had an earlier issue where the ASPNET user account did not have the
'Performance Monitor' group. The exception was an access denied when trying
to use the Windows registry. After adding the group to ASPNET we started to
get the one below.
The exception message and stack is below:
Message="Access is denied"
TargetSite="Void RegisterFiles(System.String, Boolean)"
Stack = at System.Diagnostics.PerformanceCounterLib.RegisterF iles(String
arg0, Boolean unregister)
at System.Diagnostics.PerformanceCounterLib.RegisterC ategory(String
categoryName, PerformanceCounterCategoryType categoryType, String
categoryHelp, CounterCreationDataCollection creationData)
at System.Diagnostics.PerformanceCounterCategory.Crea te(String
categoryName, String categoryHelp, PerformanceCounterCategoryType
categoryType, CounterCreationDataCollection counterData)
at System.Diagnostics.PerformanceCounterCategory.Crea te(String
categoryName, String categoryHelp, String counterName, String counterHelp)
at AT.NSA.ANM.parser..ctor()
at AT.NSA.ANM.parseGNSN..ctor()
Code line is below:
If Not (PerformanceCounterCategory.Exists("AT.ANM")) Then
PerformanceCounterCategory.Create("AT.ANM", "AT.ANM
performance counters", "Number AT.ANM.Parser objects", "Total number of
instantiated parser objects.")
End If