VSTestHost.exe running with elevated admin privileges problem VS2008 SP1 on W7 RRS feed

  • Question

  • Dear all,

    within my Test Method (C# VS2008, Windows7) I do the following:

      RegistryKey company= Registry.LocalMachine.OpenSubKey("SOFTWARE\\Company");
      RegistryKey product = company.CreateSubKey(_productName);

    For preparation of the Test I have to write a key into the HKLM part of the Registry.
    My VisualStudio is running as Administrator and I can see from Process Explorer that the VSTestHost.exe is running in elevated mode also.
    Against my expectations, the CreateSubKey creates an UnauthorizedAccessException. A started "Regedit.exe" (as Adminstrator) is capable to write the subKey with the same credentials.
    What can I do to come round this?

    Tuesday, December 22, 2009 10:10 AM

All replies

  • is this still a active issue for you?
    Thursday, April 14, 2011 5:34 AM