473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1913
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.