473,322 Members | 1,480 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,322 software developers and data experts.

Registry key cannot write..

Hi,
I write a windows service. In that service I create a new subkey for registry. But service
install is call CreateSubKey() the program throw an exception to the event log said that
Cannot write to the registry key. What can cause to this message. Also I want to create sub
key from my asp.net project. How can I authoritize to write a new for the web application
for the registry.
Thanks for your answers.
Nov 16 '05 #1
3 12478
Caldera,

You start by mentioning a Windows Service, but then make a reference to a
ASP.Net project, which would indicate it's actually a Web Service you're
talking about?

For a windows service, make sure it's running as local admin, or that the
user it is running as has rights to edit the registry.

For a web service, it's not advised you store any data in the server
registry. Rather put it in the project global configuration file.

Hope that helps.

Dan

"caldera" <ca*****@cc.com> wrote in message
news:OG*************@TK2MSFTNGP11.phx.gbl...
Hi,
I write a windows service. In that service I create a new subkey for registry. But service install is call CreateSubKey() the program throw an exception to the event log said that Cannot write to the registry key. What can cause to this message. Also I want to create sub key from my asp.net project. How can I authoritize to write a new for the web application for the registry.
Thanks for your answers.

Nov 16 '05 #2
Actually I want to use windows service for scheduling. At a period of time it checks the
values from the registry key and scheduled these key as a event. For example every day it
sends a email of the user. But entering these event from the asp.net page. I don't want to
get these events from the db. So I have to add a registry key from the asp.net page.
May be, I can do this from the web service but in this case thread of the web service
continously run. It isnot a pratical solution I think.(May be it is suitable )
Thanks for your answer

"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in message
news:#m**************@tk2msftngp13.phx.gbl...
Caldera,

You start by mentioning a Windows Service, but then make a reference to a
ASP.Net project, which would indicate it's actually a Web Service you're
talking about?

For a windows service, make sure it's running as local admin, or that the
user it is running as has rights to edit the registry.

For a web service, it's not advised you store any data in the server
registry. Rather put it in the project global configuration file.

Hope that helps.

Dan

"caldera" <ca*****@cc.com> wrote in message
news:OG*************@TK2MSFTNGP11.phx.gbl...
Hi,
I write a windows service. In that service I create a new subkey for registry. But service install is call CreateSubKey() the program throw an exception to the event log said that Cannot write to the registry key. What can cause to this message. Also I want to create sub key from my asp.net project. How can I authoritize to write a new for the web application for the registry.
Thanks for your answers.

Nov 16 '05 #3
caldera wrote:
Actually I want to use windows service for scheduling. At a period of time it checks the
values from the registry key and scheduled these key as a event. For example every day it
sends a email of the user. But entering these event from the asp.net page. I don't want to
get these events from the db. So I have to add a registry key from the asp.net page.
May be, I can do this from the web service but in this case thread of the web service
continously run. It isnot a pratical solution I think.(May be it is suitable )
Thanks for your answer
If you're trying to write to the registry in an ASP.NET web application,
the the registry must have the proper permissions for the account that
the ASP.NET application is running under (by default this is the ASPNET
account).

Make sure the ACL for the registry key that you're writing to allows the
ASPNET account to create new keys.

"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in message
news:#m**************@tk2msftngp13.phx.gbl...
Caldera,

You start by mentioning a Windows Service, but then make a reference to a
ASP.Net project, which would indicate it's actually a Web Service you're
talking about?

For a windows service, make sure it's running as local admin, or that the
user it is running as has rights to edit the registry.

For a web service, it's not advised you store any data in the server
registry. Rather put it in the project global configuration file.

Hope that helps.

Dan

"caldera" <ca*****@cc.com> wrote in message
news:OG*************@TK2MSFTNGP11.phx.gbl...
Hi,
I write a windows service. In that service I create a new subkey for


registry. But service
install is call CreateSubKey() the program throw an exception to the event


log said that
Cannot write to the registry key. What can cause to this message. Also I


want to create sub
key from my asp.net project. How can I authoritize to write a new for the


web application
for the registry.
Thanks for your answers.


--
mikeb
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bob Kirkwood | last post by:
I believe the intent in .NET is that we store application setup information in an XML file now instead of the Registry or INI files. Is this correct? Are there any tools, sample apps, or...
1
by: Zürcher See | last post by:
I'm trying to set a value in the registry in order to configure IE so that it uses a proxy I found out that there are two values: ...
7
by: Bob | last post by:
I'm working on a Windows app that needs to write to the Registry HKLM. I keep getting a "System.UnauthorizedAccessException: Cannot write to the registry key." error when running the app. I'm...
6
by: Steven Blair | last post by:
Hi, My C# app uses the registry for storing DB params, but under Windows XP SP2, a normal user cannot write to this key (a .NET exception is thrown when the app is run, but only under this OS)....
8
by: Al Kaufman | last post by:
I have a simple console app that uses: regSubKey = <some registry key> Dim reg As RegistryKey = Registry.ClassesRoot.OpenSubKey(regSubKey) Dim path As String path = CStr(reg.GetValue(""))
17
by: Sam | last post by:
Hi all If I only want to store screen location and size of my application in Windows Registry, which of the keys should I store this info? A sample code is greatly appreciated. Thank you ...
9
by: Newbie Coder | last post by:
Hello Newsgroup Readers I would like to know how to go & do the following: I have a certain registry key that has sub values Example: Key1 http://www.microsoft.com Key2 ...
4
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I have Visual Studio 2005 Express Edition. I am trying to change registry value by: RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\My_app"); key.SetValue(name_of_value,...
20
by: Newbie Coder | last post by:
MFC Application VC++.NET 2003 I have a certain registry key (HKCU\Software\MyKey) that contains between 30 & 64 string values I need to write a '*' to all those 30 - 64 string values under...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.