c# - When deleting and creating performance counters in a service it can hang the service -


In the app I wrote that as the app spin-up we delete and redraw the display counters.

When it is running from the console, the application removes and fixes the counter and counter category.

When we run from a service, the app removes the counter category as the candidate, but when it creates a new category, the service time out

  if ( PerformanceCounterCategory.Exists (CATEGORY_NAME)) {PerformanceCounterCategory.Delete (CATEGORY_NAME); }  

works properly, but then hanged in this method

  Personal ShowConcenter category Entertainment (category) {PerformanceCounterCategory category = faucet; If (! PerformanceCounterCategory.Exists (CATEGORY_NAME)) {category = PerformanceCounterCategory.Creative (CATEGORY_NAME, CATEGORY_HELP, PerformanceCounterCategoryType.SingleInstance, counterCreationDataCollection); } Return range; }  

on. Axis Line I hope it has something to do with the permission, but as the production requires us to run the service as a local system, i need to fix it in code without raising the user account.

Thank you

I got the solution, make me your IOC in the onstart () method Needed and not a creator


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -