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.Strin
g, Boolean)"
Stack = at System.Diagnostics.Perform
anceCounte
rLib.Regis
terFiles(S
tring arg0, Boolean unregister)
at System.Diagnostics.Perform
anceCounte
rLib.Regis
terCategor
y(String categoryName, PerformanceCounterCategory
Type categoryType, String categoryHelp, CounterCreationDataCollect
ion creationData)
at System.Diagnostics.Perform
anceCounte
rCategory.
Create(Str
ing categoryName, String categoryHelp, PerformanceCounterCategory
Type categoryType, CounterCreationDataCollect
ion counterData)
at System.Diagnostics.Perform
anceCounte
rCategory.
Create(Str
ing 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 (PerformanceCounterCategor
y.Exists("
AT.ANM")) Then
PerformanceCounterCategory
.Create("A
T.ANM", "AT.ANM performance counters", "Number AT.ANM.Parser objects", "Total number of instantiated parser objects.")
End If
Start Free Trial