472,780 Members | 1,265 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 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 1868
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harbinger of Doom | last post by:
Hello, I'm currently working on a program that has to read values from the windows registry. I use the functions "RegOpenKeyEx", "RegCloseKey" and "RegQueryValueEx" for that. If I can read the...
1
by: Duncan Allen | last post by:
I'm trying to use aspnet_setreg to encrypt user names & password used in the web.config file for use in the indentity element. When the website runs I get the message 'Error reading the password...
6
by: Bry | last post by:
I'm having problems writing (and reading) boolean data to the registry. // Write a boolean value to the registry // I've not included the obvious bits of code in these samples bool myBool =...
1
by: Peter John | last post by:
I am using the following code to read from and write to the registry. The writing works fine but reading always fails. Can anyone suggest what is going wrong? Imports Microsoft.Win32 Public...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
3
by: Mike Malter | last post by:
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),...
5
by: UJ | last post by:
I have a system that has five programs that all communicate with each other via Message Queues. Works well. One program is a watchdog that will make sure the others are up and going. Currently I...
0
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain,...
3
by: Henk | last post by:
Hi, Is there a way to read a registry key from HKLM from an asp.net page? regards, Henk
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.