473,888 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Voi d RegisterFiles(S ystem.String, Boolean)"
Stack = at System.Diagnost ics.Performance CounterLib.Regi sterFiles(Strin g
arg0, Boolean unregister)
at System.Diagnost ics.Performance CounterLib.Regi sterCategory(St ring
categoryName, PerformanceCoun terCategoryType categoryType, String
categoryHelp, CounterCreation DataCollection creationData)
at System.Diagnost ics.Performance CounterCategory .Create(String
categoryName, String categoryHelp, PerformanceCoun terCategoryType
categoryType, CounterCreation DataCollection counterData)
at System.Diagnost ics.Performance CounterCategory .Create(String
categoryName, String categoryHelp, String counterName, String counterHelp)
at AT.NSA.ANM.pars er..ctor()
at AT.NSA.ANM.pars eGNSN..ctor()

Code line is below:

If Not (PerformanceCou nterCategory.Ex ists("AT.ANM")) Then
PerformanceCoun terCategory.Cre ate("AT.ANM", "AT.ANM
performance counters", "Number AT.ANM.Parser objects", "Total number of
instantiated parser objects.")
End If
May 8 '07 #1
1 6668
"Robert Strickland" <bs*********@co mporium.netwrot e in message
news:u$******** ******@TK2MSFTN GP04.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="Voi d RegisterFiles(S ystem.String, Boolean)"
Stack = at System.Diagnost ics.Performance CounterLib.Regi sterFiles(Strin g
arg0, Boolean unregister)
at System.Diagnost ics.Performance CounterLib.Regi sterCategory(St ring
categoryName, PerformanceCoun terCategoryType categoryType, String
categoryHelp, CounterCreation DataCollection creationData)
at System.Diagnost ics.Performance CounterCategory .Create(String
categoryName, String categoryHelp, PerformanceCoun terCategoryType
categoryType, CounterCreation DataCollection counterData)
at System.Diagnost ics.Performance CounterCategory .Create(String
categoryName, String categoryHelp, String counterName, String counterHelp)
at AT.NSA.ANM.pars er..ctor()
at AT.NSA.ANM.pars eGNSN..ctor()

Code line is below:

If Not (PerformanceCou nterCategory.Ex ists("AT.ANM")) Then
PerformanceCoun terCategory.Cre ate("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
4754
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 large amount of performance data and updating it fairly quickly. Not surprisingly, we keep coming up with more and more performance data we'd like to be writing to the registry. My job is to come up with a test harness to establish the following:...
8
4205
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 the log: 1 4:31:10 PM BlockedConfigAp:1340 IRP_MJ_CREATE A: DASD SUCCESS Attributes: Any Options: Open 2 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_DEVICE_CONTROL A: DASD INVALID DEVICE REQUEST IOCTL: 0x560000 3 4:31:11 PM BlockedConfigAp:1340...
7
3694
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 to it, using installutil.exe OR is it must to have an installer to the service project to be able to
1
4107
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 Server 2000 enterprise manager, I create a linked server, I use ibm oledb driver for db2, datasource = mydatabase, product=my database, provider = db2oledb. When I try to access the database via an openquery to the linked server, I get an error from...
12
2441
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 and saves it to a folder. The DLL even writes to a log for each step it takes so we can troubleshoot the problems (if any). This works fine on one machine but not another. The folder the DLL is trying to write to has full permissions assigned...
7
12120
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 registry access is not allowed." SecurityException when I try and create the performance counter category via PerformanceCounterCategory.Create(). I understand the login used to run the Web Service does not have access to the registry keys...
0
1240
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 key 'Global' is denied" when performance counters are accessed. A google search yielded nothing useful. How do I fix this? Thanks,
8
28651
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 made a simple database in jsp(just to check if my mysql is working smoothly otherwise) which access' the username.....but in the process im getting a error--> java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO) i have...
5
12593
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 existing app.pool gives same results). This webapplication tries to write to a log file. Used Process Monitor (from Sysinternals) for monitoring purposes. Logged in to my machine as 'MYPC\danny', a local account that's a member of the administrators...
0
9957
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11173
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10434
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7143
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4635
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4239
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.