Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7418369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:52:29+00:00 2026-05-29T07:52:29+00:00

When trying to create custom performance counters as explained in this MSDN article ,

  • 0

When trying to create custom performance counters as explained in this MSDN article, I still get a security exception.

The code I am using is the same as in that article, only I am creating a different counters.

I understand that I can try to create it in a start-up task, but for now I want to do it inside the role.. it should work :/

The exception:

[SecurityException: Requested registry access is not allowed.]
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +12746267
   System.Diagnostics.PerformanceCounterLib.CreateRegistryEntry(String categoryName, PerformanceCounterCategoryType categoryType, CounterCreationDataCollection creationData, Boolean& iniRegistered) +170
   System.Diagnostics.PerformanceCounterLib.RegisterCategory(String categoryName, PerformanceCounterCategoryType categoryType, String categoryHelp, CounterCreationDataCollection creationData) +49
   System.Diagnostics.PerformanceCounterCategory.Create(String categoryName, String categoryHelp, PerformanceCounterCategoryType categoryType, CounterCreationDataCollection counterData) +558

The beginning of my ServiceDefinition.csdef:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="Jonathan.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
  <WebRole name="WebDriver" vmsize="Small" enableNativeCodeExecution="true">
    <Runtime executionContext="elevated" />

When I RDP into the role, I can see that the application pool is still running with the NetworkService identity, was expecting it to run under a different principal as I changed the role to be ‘elevated’ – manually setting up a custom principal with permissions solves this, but it will be over-ridden once the role reconfigure itself or if I deploy an upgrade – in any case, this is not really a solution but a hack :/ [frustrated]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:52:30+00:00Added an answer on May 29, 2026 at 7:52 am

    In the case of Web Role of Full IIS, the special privilege which you appointed in Runtime element is applied to RoleEntoryPoint. I think that it is necessary to register a custom performance counter by inner RoleEntryPoint (usually WebRole.cs) OnStart method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create custom bullet points and it is not working. This
I am trying to create a custom scrollbar and am using images as button.
I am trying create custom namespaces after reading the article at Custom Namespaces I
I'm trying to create custom view that draws image downloaded from Url. The code
I'm trying to create a custom search interface for Apache Solr using Drupal ,
I am trying create my custom Style spinner with help of this site. But
I am trying to create custom array indexed from 1 using subscript operator. Getting
Im trying to create a custom version of the RequiredAttribute to replace the built
I'm trying to create a custom JSP tag that would take an array object
I am trying to create a custom accordion for my page to that display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.