views:

198

answers:

1

We have some unit tests which work with performance counters (specifically creating new categories) and on XP/2003 they work fine but on Vista/7 they fail with a SecurityException ("Requested registry access is not allowed"). I tried checking the "Run as administrator" box on the properties for VSTestHost.exe, but that causes all tests to fail immediately marked with with an Error and no message.

Does anyone have any suggestions for running Visual Studio Unit Tests (ideally just these tests) with administrative privileges?

+2  A: 

Here's my solution: Set devenv.exe to "Run as Administrator" under Properties and Compatibility tab. Voila!

Neil C. Obremski