473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Access is denied when creating Windows Performance Counters

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
May 8 '07 #1
1 6632
"Robert Strickland" <bs*********@comporium.netwrote in message
news:u$**************@TK2MSFTNGP04.phx.gbl...
>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
Does the counter already exist on the machine experiencing the exception? If
not, then perhaps the code above will attempt to create it. In that case,
your ASP.NET process may have access to read and write the counter, but not
to create it.
--
John Saunders [MVP]
May 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Mitchell | last post by:
Hello group, I'm trying to write code to test an application we're developing. This application needs to store its own performance data in the registry, and we'd like to be storing quite a...
8
by: Ken Varn | last post by:
Everytime I call Process.GetCurrentProcess() the system goes out to the floppy drive. Why does this happen. I decided to use FileMon to get a log of what is happening when this occurs. Here is...
7
by: sidd | last post by:
Hi All, i have some doubts on .net windows services.. please see if some one could help me understand this.. 1)is it possible to install a windows service which does not have a installer added...
1
by: Lyn Duong | last post by:
Hi, I have tried creating a linked server in microsoft sql 2000 to a db2 for vm database. I use a db2 v8 admin client, configure it via client configuration setup and then in Microsoft SQL...
12
by: D. Shane Fowlkes | last post by:
This most likely belongs in another forum but I thought I'd start here. I have a COM Object written in VB6. The DLL will access MS Excel and use it's Object Library to write a customized report...
7
by: Peter Ritchie | last post by:
I'm writing a Web Service and I would like to add performance counter data for monitoring performance of the Web Service's operations over time and load. The problem is, I get the "Requested...
0
by: Gary Brown | last post by:
Hi, An application newly moved to Vista Home Premium on a new laptop cannot access performance counters. The application itself faults. Service Explorer (VS 2005) yields "Access to the registry...
8
by: ajos | last post by:
hi frnds, im trying to convert my servlets database configuration from ms access to mysql database.however im getting some error like no driver found exception. to verify this error ive...
5
by: DotNetDanny | last post by:
Hello Machine: Windows Vista Business, standalone machine (no domain). Installed an old classic ASP webapplication in IIS7, running under a new app.pool with 'NETWORK SERVICE' account (using...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.