1

I am trying to get a program to run but I am met with a Access to registry key 'Key goes here!' is denied. The following is the line of code that is giving me this error:

RegistryKey registry = Registry.LocalMachine.CreateSubKey(@"path goes here");

I am running Windows 7 Ultimate 32 bit. I am using an administrator account. The project also has a vshost.exe.manifest file which I tried editing. However, when I change the requiredExecutionLevel and subsequently run the program the changes revert back. How do I fix this issue?

SecretBit
  • 127
  • 2
  • 16
  • 1
    You are modifying the wrong manifest file. Modify your app.manifest in the source. If you don't have one, add new item, and select 'Application Manifest File'. – Jeff Feb 19 '14 at 20:18
  • possible duplicate of [How to force my .NET App to run as administrator on Windows 7?](http://stackoverflow.com/questions/2818179/how-to-force-my-net-app-to-run-as-administrator-on-windows-7) – Hans Passant Feb 19 '14 at 20:32
  • Jeff - your comment should be an answer. Hans - it's a different question, even if the answer may be the same. – Josh Gallagher Feb 19 '14 at 21:03
  • I created the app.manifest file and am running VS as an administrator. But I am getting a file not found `path to exe/*.exe` error. – SecretBit Feb 19 '14 at 22:32

0 Answers0