I am trying to create a DWORD in the LocalMachine registry field using a WinForms (C#) application.
No errors are raised, but the entry is never created.
RegistryKey registryKey;
registryKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\InetStp\Configuration");
registryKey.SetValue("MaxWebConfigFileSizeInKB", 512, RegistryValueKind.DWord);
Any ideas?
I had a similar problem before.
With the lasts version of windows you can't write directly to the
LocalMachine
emplacement due to security concern.They are no error because the key is created in another emplacement. Did you try searching for your key ? Try to execute your program in Admin mode it may create the key.
Edit:
After some test i found that in Admin mode the key is created in:
But in normal user mode i have the following error: