CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166

    Unhappy Starting Windows Service fails: 'access denied'

    Hi, Gurus!

    I have created a windows service in C#.

    My problem:
    I can install it with installutil.exe but when I try to start it, I get an 'Error 5: Access denied' messagebox!

    Here some System-Info:

    + My OS is Windows 2000.
    + Net-Framework-Version is v1.1.4322.
    + I'm logged on as an administrator and have full access to the windows-installer-folder, so this cannot be the reason for the error.

    TIA for Your help!

    Mikey

  2. #2
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129

    Wink

    hmmz... can you please post a code that you use to start that service? that might help...
    Regards,
    Alexei

  3. #3
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    Hi Alexei,

    Thanks for Your reply!

    This error occurs even with the simplest form of a Windows Service which was generated by the "New Project"-Visual.Net-Wizard.

    All I did "on my own" was adding an Installer-Class by clicking the "Add Installer"-link!


    Thanks for further Help!

    Mikey

  4. #4
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    hmmz... wait a second... so you are trying to intall by clicking from the link on your form?!
    Regards,
    Alexei

  5. #5
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    no, no,

    I have installed the service (with "LocalSystem-Account") with the installutil-tool. That works fine.

    But when I try to start it, e.q. via "net start service1" I get that error "access denied"!

    ???


    Mikey

    still

  6. #6
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    hmmz... if youve installed the services... how about checking what type of settings it has (Auto/Manual/Disabled)..

    Maybe its simply disabled and you cant start it... that way you will always get that error...
    why not use Process.Start("service1.exe")??

    Wouldnt it be better?
    Regards,
    Alexei

  7. #7
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    Thanks, Alexei,

    but the service isn't disabled. The StartUp-type is set to 'Manual'.

    In the Services Property-Dialog I can even change the StartUp-type for my service!
    But I just cannot start it.

    ???

    Mikey

  8. #8
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    hmmz... you say Mikey ... now its Alexei
    I have NO idea what so ever about the reason of this problem...
    Can you try setting in to Automatic and rebooting your PC? to see that the service really starts...
    Regards,
    Alexei

  9. #9
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    You're right.

    When I reopen the Service Property-Dialog the StartUp-type is set back to 'Manual'. So I can't change it also.

    ???

  10. #10
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    hmmz... weird weird... okej... lets see...
    any code youve writen for that service or is it just a wizard-created service without any additions?
    Regards,
    Alexei

  11. #11
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    it is just wizard created! no additions!

  12. #12
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    WAIT!!!!!!!!
    I might just have the solution...
    It said -- access denied, right? so why not try to clode EVERYTHING that might be using that service
    Including VS.net and even rebooting your PC... just try... it might work
    Regards,
    Alexei

  13. #13
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    Good idea!

    I'll try it...

  14. #14
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    Good luck
    Regards,
    Alexei

  15. #15
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    166
    Hi, Alexei!

    Noop... - Didn't work

    I also copied it to my second computer. Same behavior...

    I feel, I have to talk to my psychotherapist...


    Alexei, have You checked Your e-mail?
    I've sent You the code. Can You reproduce the error on Your machine?

    ???

    still

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured