how to set security rights in order to write to the registry?

From: Egmont Gabler (info@gabler-systemtechnik.de)
Date: 12/17/02


From: "Egmont Gabler" <info@gabler-systemtechnik.de>
Date: Tue, 17 Dec 2002 18:09:44 +0100


Within my ASP.NET web app I want to write to the registry. After trying to
open a registry key using
RegistryKey key =
Registry.LocalMachine.OpenSubKey("Software\\MyCompany\\MySoftware", true);
within my aspx.cs file I get the error message:
System.Security.SecurityException: Requested registry access is not allowed.

I already set the following configuration settings:
1) change the username within machine.config to "system" (<processModel ...
userName="system" ...>)
2) Set the following entry within web.config of the web project:
 <system.web>
  <identity impersonate="true" />
...
3) Run "mscorcfg.msc"->Runtime Security Police->Adjust Zone Security and set
all zones to full trust
4) Run "mscorcfg.msc"->Increase assembly trust and add full trust for all my
project assemblies
5) Let the ASPNET (aspnet_wp) user account be a member of the administrators
group
6) Set the IE security options for all zones to the lowest possible value
and add my local web site to the trusted sites of my local intranet.

As one can see I REALLY would like to write to the registry but I always get
the same error message. (Of course I can read from the registry when
suppressing the "true" flag in the function call.) Is there any
configuration stuff I should try too? Any hints are very welcome!

Egmont



Relevant Pages

  • Re: hijack this startup - can someone tell me the hack i am experienci
    ... | *Registry key not found* ... | *Registry value not found* ... | Autorun entries from Registry: ... | Intel82801 Audio Driver Install Service: ...
    (microsoft.public.windowsxp.security_admin)
  • Help with Outlook profile script
    ... I would like to have a script that checks if the correct Outlook profile is configured in the users profile. ... Outlook profiles are configured in the following registry key: ...
    (microsoft.public.scripting.vbscript)
  • Re: Cannot Delete Registry Key
    ... > to the permissions on the bad key, ... >> [[Incorrectly editing the registry may severely damage your system. ... >> take ownership of the registry key by the current owner. ... >> MS-MVP Windows Shell/User ...
    (microsoft.public.windowsxp.security_admin)
  • RE: RWW: version=1 msgtype=status status=-3 message=Password Inco
    ... Create a new folder on the desktop and move all the plug-ins in the ... Remove registry keys. ... Find and delete the following registry key. ... please capture a screen shot of the error so ...
    (microsoft.public.windows.server.sbs)
  • Re: Cannot install new printer drivers
    ... What is the registry key that Process Monitor reported ACCESS DENIED for? ... The only ACCESS DENIED message I saw that had anything to do with the ...
    (microsoft.public.windowsxp.print_fax)