Home All Groups Group Topic Archive Search About

Performance counter problem

Author
27 Nov 2006 10:13 PM
dwhite
Our software package works fine under XP but when I run under Vista RC1
as an administrator I get the following exception:

Exception has been thrown by the target of an invocation. --->
System.Security.SecurityException: Requested registry access is not
allowed.\r\n   at
System.ThrowHelper.ThrowSecurityException(ExceptionResource
resource)\r\n   at Microsoft.Win32.RegistryKey.OpenSubKey(String name,
Boolean writable)\r\n   at
System.Diagnostics.PerformanceCounterLib.CreateRegistryEntry(String
categoryName, PerformanceCounterCategoryType categoryType,
CounterCreationDataCollection creationData, Boolean& iniRegistered)\r\n
  at System.Diagnostics.PerformanceCounterLib.RegisterCategory(String
categoryName, PerformanceCounterCategoryType categoryType, String
categoryHelp, CounterCreationDataCollection creationData)\r\n   at
System.Diagnostics.PerformanceCounterCategory.Create(String
categoryName, String categoryHelp, PerformanceCounterCategoryType
categoryType, CounterCreationDataCollection counterData)\r\n   at
GSD.Telematics.SenseNetAPI.SenseNet.SetUpPerformanceTracking()\r\n   at
GSD.Telematics.SenseNetAPI.SenseNet..ctor()\r\nThe Zone of the assembly
that failed was:\r\nMyComputer\r\n   --- End of inner exception stack
trace ---

At this spot in the code we are trying to create a performance counter
group with performance counters inside it. I can not seem to find any
information anywhere on what has changed in Vista to cause this. I am
running as an administrator on the machine and am in the Performce
Counter groups in Vista. Any thoughts or pointers would be appreciated.

David White
GSD Telematics

Author
28 Nov 2006 9:55 AM
Steve Drake
Could this be UAC?

If you login as Admin in vista any process you create runs without your
admin rights, unless they are 'told' too.

We use Perf Counters in our APP but we creat them as part of the installer.

Show quote
"dwhite" <dwh***@gsdtelematics.com> wrote in message
news:1164665624.225540.6010@45g2000cws.googlegroups.com...
> Our software package works fine under XP but when I run under Vista RC1
> as an administrator I get the following exception:
>
> Exception has been thrown by the target of an invocation. --->
> System.Security.SecurityException: Requested registry access is not
> allowed.\r\n   at
> System.ThrowHelper.ThrowSecurityException(ExceptionResource
> resource)\r\n   at Microsoft.Win32.RegistryKey.OpenSubKey(String name,
> Boolean writable)\r\n   at
> System.Diagnostics.PerformanceCounterLib.CreateRegistryEntry(String
> categoryName, PerformanceCounterCategoryType categoryType,
> CounterCreationDataCollection creationData, Boolean& iniRegistered)\r\n
>  at System.Diagnostics.PerformanceCounterLib.RegisterCategory(String
> categoryName, PerformanceCounterCategoryType categoryType, String
> categoryHelp, CounterCreationDataCollection creationData)\r\n   at
> System.Diagnostics.PerformanceCounterCategory.Create(String
> categoryName, String categoryHelp, PerformanceCounterCategoryType
> categoryType, CounterCreationDataCollection counterData)\r\n   at
> GSD.Telematics.SenseNetAPI.SenseNet.SetUpPerformanceTracking()\r\n   at
> GSD.Telematics.SenseNetAPI.SenseNet..ctor()\r\nThe Zone of the assembly
> that failed was:\r\nMyComputer\r\n   --- End of inner exception stack
> trace ---
>
> At this spot in the code we are trying to create a performance counter
> group with performance counters inside it. I can not seem to find any
> information anywhere on what has changed in Vista to cause this. I am
> running as an administrator on the machine and am in the Performce
> Counter groups in Vista. Any thoughts or pointers would be appreciated.
>
> David White
> GSD Telematics
>
Author
28 Nov 2006 5:17 PM
dwhite
So I got bit by UAC huh? Obviously one solution is to install them
upfront (which I think is good anyways) but in the mean time do I just
tell it to run under Administrator? Thanks for the help

David White
GSD Telematics

AddThis Social Bookmark Button