473,792 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 .SecurityExcept ion: 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 1950
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********@new sgroup.nospam> wrote in message
news:eA******** ******@TK2MSFTN GP14.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 .SecurityExcept ion: 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 SecurityExcepti on is thrown. If there is any
misunderstandin g, 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..jwaon line..com
-----------------------------------------------------------------------
"Mike Malter" <mi********@new sgroup.nospam> wrote in message news:eA******** ******@TK2MSFTN GP14.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 .SecurityExcept ion: 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
19849
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 manual correctly (which I hope I can) I have to include windows.h, winnt.h and winreg.h The constructor of one of my classes looks like this:
1
5027
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 from the registry'. I'm using Windows XP SP2, Framework 1.1 . The code in the web.config file is : <identity impersonate="true" password="registry:HKLM\SOFTWARE\MyCompany\MyApp\Website\Identity\ASPNET_SETREG,password...
6
17846
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 = true; myRegistryKey.SetValue("SomeValue", myBool); This gives me a registry value with string data containing "True" // Read my boolean data back from the registry
1
1672
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 Class clsRegistry Private Const conRegKey As String = "Software\MyCompany\MyApplication"
5
8958
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 headers). I used ODBC in my VB.NET program to read that spreadsheet into a dataset, to make it easy to manipulate. The code I use to read it is as the bottom of this posting.
3
288
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), 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...
5
5089
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 have it store info it gets from when the programs check in into a DataSet (XML file). Problem is, that file now has to be used by other programs to find out version information (the file is ALWAYS less that 1K.) The record itself is only five fields...
0
4007
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, but my department has a couple of web servers of our own that are part of my organization's domain. I am trying to read LDAP information on my organization's domain controller from a web application on one of my department's servers. I have been...
3
1043
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
9670
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10159
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.