By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,732 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,732 IT Pros & Developers. It's quick & easy.

Registry key cannot write..

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.