.NET Registry Error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: .NET Registry Error

  1. #1
    Join Date
    Mar 2007
    Posts
    6

    .NET Registry Error

    Hi,
    I write a windows service. In that service I create a new subkey for registry. This service calls CreateSubKey() function. (in C#) When i run it, the program throw an exception to the event log said that
    "Unauthorized error. Cannot write to the registry key". What can cause to this message??
    (I logged in as an administrator)
    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Is the service running under the Administrator account?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Mar 2007
    Posts
    6

    Registrty

    Thank you Phil but
    as I mentioned, I was running the service under the Administrator account.
    Last edited by GabrielS; 06-25-2007 at 04:51 AM.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    That's actually not what you said. ;-) You said you logged in as Administrator; the service does not necessarily run under the user account with which you logged in.

    If the service is indeed running under the Administrator account, then I'm not sure what would cause the error. You might try using a tool like RegMon to see which registry key is causing the error.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 5
    Last Post: 01-17-2007, 01:37 PM
  2. Link error
    By Shar in forum C++
    Replies: 5
    Last Post: 12-19-2006, 06:07 AM
  3. writing to registry: No error, but also no effect
    By Johnny Knoxville in forum VB Classic
    Replies: 0
    Last Post: 05-13-2002, 06:14 AM
  4. Writing in HKEY_LOCAL_MACHINE...Access is denied
    By Martin in forum VB Classic
    Replies: 22
    Last Post: 12-03-2001, 03:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center