Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8907723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:59:19+00:00 2026-06-15T02:59:19+00:00

The service installs correctly but when attempting to start it via net start or

  • 0

The service installs correctly but when attempting to start it via net start or from the services window it doesn’t start at all, not even getting to the OnStart handler.

If I use an administrator account, the service starts and works correctly. This seems to suggest something in the service requires admin privileges but this is purely an on-demand style service with nothing executing until requested. With this type of service I’d assume that is should at least start and then fail later when a request is made to it that requires admin privileges?

It’s impossible to debug as I can’t even get it to start and nothing is appearing on the event logs apart from an Information log stating that the service stopped. There’s too much code in the service to add it all here but the entry point is a fairly standard Unity style service:

partial class MyServiceHost : UnityServiceBase
{
    private Bootstrapper _bootstrapper;

    public MyServiceHost()
    {
        InitializeComponent();
    }

    protected override void OnStart( string[] args )
    {
        TextWriter tw = new StreamWriter( "ServiceTestLog.txt" );
        tw.Write( "Date: " + DateTime.Now + "\n" );

        try
        {
            base.OnStart( args );

            _bootstrapper = new Bootstrapper( UnityContainer );
            _bootstrapper.Run();
        }
        catch ( Exception ex )
        {
            tw.Write( ex.ToString() );
        }

        tw.Close();
    }

    protected override void OnStop()
    {
        _bootstrapper.Teardown();
        base.OnStop();
    }
}

For business reasons I can’t just make the user account it uses an administrator so I’d appreciate any suggestions on how to fix this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:59:20+00:00Added an answer on June 15, 2026 at 2:59 am

    Writing to “ServiceTestLog.txt” may require local admin rights.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a windows service. It installs fine, but fails when I
I'm trying to deploy a windows service but not quite sure how to do
I need to start a program from Windows Service. That program is a user
I have a net.connect script that I am attempting to install as a service
I have a WiX based MSI that installs a service and some shortcuts (and
I'm using WiX 3.5 to create an installer that installs a Windows Service and
I have a windows installer project which installs some software (winform, service, mce addin).
I have an installer which installs services and then starts them. On some machines
I try to inject log4net in a ILogger property of my service class but
This is not technically a programming question but it does specifically relate to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.