Registry SetAccessControl
===

    string user = @"NT AUTHORITY\NETWORK SERVICE";
    RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\services\eventlog");
    RegistrySecurity regSec = new RegistrySecurity();
    RegistryAccessRule rule = new RegistryAccessRule(
                    user,
                    RegistryRights.FullControl,
                    InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit,
                    PropagationFlags.InheritOnly,
                    AccessControlType.Allow);
    regSec.AddAccessRule(rule);
    
    key.SetAccessControl(regSec);

I'm getting System.Unauthorizedaccessexception: "Cannot write to the registry key." at     `key.SetAccessControl(regSec);`

I'm running the app as admin.