Search code examples
.netwindowsiis-7permissionsperformancecounter

Set permissions on ApplicationPoolIdentity for adding performance counters?


Hi,

I have a WCF(TCP/IIS7) application that needs to add performance counters on startup, this is a bit of my code for that :

category = PerformanceCounterCategory.Create("Orbit5Service", "MyApp Application Service Counters", PerformanceCounterCategoryType.SingleInstance, col);

The problem is that this will throw an "Requested registry access is not allowed." excetpion. I really need to add this performance counters on startup so how do I grant the ApplicationPoolIdentity the rights to do that?


Solution

  • I hade to change the account that runes the AppPool to a account that do have admin rights.