471,349 Members | 1,178 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Reading Registry Errors

On my XP Professional dev machine, I am able to read the registry by giving
permissions to the ASP.NET account on the local machine.

When I transfer the code to my staging server (Windows 2003), I am getting a
System.Security.SecurityException: Requested registry access is not allowed.

The key is there, I exported it from my XP machine. The permissions are there, and I
can see in the error message the code breaks where I try to read the key.

I am new to using the registry in web apps, and am wondering if there are additional
settings required on a Windows 2003 server to allow my web app to read the registry.

Thank you.
Jul 21 '05 #1
3 1781
I believe regedt32 lets you change security settings but regedit does not.
I may be misremembering.

In newer versions, sections of the registry have their own permissions (just
like files) and servers are generally locked down rather tightly.

"Mike Malter" <mi********@newsgroup.nospam> wrote in message
news:eA**************@TK2MSFTNGP14.phx.gbl...
On my XP Professional dev machine, I am able to read the registry by
giving permissions to the ASP.NET account on the local machine.

When I transfer the code to my staging server (Windows 2003), I am getting
a System.Security.SecurityException: Requested registry access is not
allowed.

The key is there, I exported it from my XP machine. The permissions are
there, and I can see in the error message the code breaks where I try to
read the key.

I am new to using the registry in web apps, and am wondering if there are
additional settings required on a Windows 2003 server to allow my web app
to read the registry.

Thank you.

Jul 21 '05 #2
Hi Mike,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're trying to read the registry
on an Windows 2003 machine, a SecurityException is thrown. If there is any
misunderstanding, please feel free to let me know.

As far as I know, in IIS6, the ASP.NET apps are running under a working
process named w3wp.exe. This process is under the account of Network
Service. You can open the Task manager and check in the process tab.

To make your app access registry successfully, you can change the account
that your app is running. Here are the step:

1. Open IIS manager in Administrative Tools.
2. Under the website, find your ASP.NET application. Right click on it and
select properties.
3. In the Directory tab you'll see the application pool your app is
running. On my machine, it's the DefaultAppPool.
4. On the left pane, find DefaultAppPool under Application Pool folder.
5. Right click on DefaultAppPool and select properties.
6. Under Identity tab, you can change the identity to local system.
7. Start -> Run. Type iisreset and press enter to restart IIS.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
I would worry less about getting access to the registry from a web app and more about that design. A live server should be
configured properly for your application to run, so you shouldn't have to check anything in the registry. The application should
assume that the envirnoment is set up properly. Giving the ASPNET user account registry access is a potential security risk.
--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Mike Malter" <mi********@newsgroup.nospam> wrote in message news:eA**************@TK2MSFTNGP14.phx.gbl...
On my XP Professional dev machine, I am able to read the registry by giving permissions to the ASP.NET account on the local
machine.

When I transfer the code to my staging server (Windows 2003), I am getting a System.Security.SecurityException: Requested registry
access is not allowed.

The key is there, I exported it from my XP machine. The permissions are there, and I can see in the error message the code breaks
where I try to read the key.

I am new to using the registry in web apps, and am wondering if there are additional settings required on a Windows 2003 server to
allow my web app to read the registry.

Thank you.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Harbinger of Doom | last post: by
1 post views Thread by Peter John | last post: by
5 posts views Thread by Scott M. Lyon | last post: by
3 posts views Thread by Mike Malter | last post: by
3 posts views Thread by Henk | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.