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

  • SEARCH
  • Home
  • 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 730927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:58:04+00:00 2026-05-14T06:58:04+00:00

Scenario I’ve got a windows service written in C#. I’ve read all the google

  • 0

Scenario

I’ve got a windows service written in C#.
I’ve read all the google threads on how to debug it, but I still can’t get it to work.
I’ve run “PathTo.NetFramework\InstallUtil.exe C:\MyService.exe”. It said the install was successful, however when I run “Services.msc”, The service isn’t displayed at all, anywhere. If I go into Task Manager, there is a process called “MyService.vshost.exe”. Pretty sure that’s not it, because it’s a service, not a process.

Can Someone Explain To Me?

If I am supposed to see the service when I run Services.msc?
(Bearing in mind this is all being done on a local machine, with no servers AT ALL.

Other

I’m running VS2008.

EDIT:

This is all being done on my local machine, I have no servers or access to any.
Also, I don’t even know what the service does, I want to debug it so I can walkthrough the code and see how it all works (the code inside the service, not the service itself – for any of you smarty pants that might suggest I look at a template).

EDIT 2:

NONE OF THESE ARE WORKING!
Everytime I try something I get some message about having to use NET START or install the service.

EDIT 3:

I’m running VS2008.

I typed this:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\dev\Restarter\bin\Release\Restarter.exe

I got this:
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\dev\Restarter\bin\
Release\Restarter.exe assembly’s progress.
The file is located at C:\dev\Restarter\bin\Release\EDT.Restar
ter.InstallLog.
Installing assembly ‘C:\dev\Restarter\bin\Release\Restarter.exe’.
Affected parameters are:
logtoconsole =
assemblypath = C:\dev\Restarter\bin\Release\Restarter.exe
logfile = C:\dev\Restarter\bin\Release\Restarter.InstallLog

The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:\dev\Restarter\bin\
Release\Restarter.exe assembly’s progress.
The file is located at C:\dev\Restarter\bin\Release\Restar
ter.InstallLog.
Committing assembly ‘C:\dev\Restarter\bin\Release\Restarter.exe’.
Affected parameters are:
logtoconsole =
assemblypath = C:\dev\Restarter\bin\Release\Restarter.exe
logfile = C:\dev\Restarter\bin\Release\Restarter.InstallLog

The Commit phase completed successfully.

The transacted install has completed.

C:\Program Files\Microsoft Visual Studio 9.0\VC>

I then went to RUN -> Services.msc
I can see nothing in there.

There is a process in Task Manager called “Restarter.vshost.exe”.

That’s it.

I only wanted to install and debug it.
I know it works (as it it runs and doesn’t crash).
But the code was written by a friend and I want to understand the underlying code by walking through it in debug mode.

  • 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-05-14T06:58:04+00:00Added an answer on May 14, 2026 at 6:58 am

    I recommend following pattern for debug:

     var ServiceToRun = new SomeService(); 
     if (Environment.UserInteractive)
     {
        // This used to run the service as a console (development phase only)
    
        ServiceToRun.Start();
    
        Console.WriteLine("Press Enter to terminate ...");
        Console.ReadLine();
    
        ServiceToRun.DoStop();
     }
     else
     {
        ServiceBase.Run(ServiceToRun);
     }
    

    Edit: make sure that your target is Console Application, not Windows Application, otherwise it will not work.

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

Sidebar

Related Questions

Scenario You've got several bug reports all showing the same problem. They're all cryptic
Scenario: Third party web service returns datetime in two separate fields i.e. date and
Scenario I have got this form: <form action=EditShippingInfo.asp method=POST id=frmShippingInfo> <!-- stuff --> <input
Scenario: The user can select a time interval (such as 5h). Every 15 minutes
SCENARIO: In windows Phone 7, I am using a list box. Assume there are
Scenario : Multiple product images, one main image. Currently, I've got 2 tables to
Scenario: A huge Patient class/entity with around 100 properties. But in the webpage I
Scenario: Windows server in a AD domain hosting a Subversion repository using SVNSERVE only
Scenario A SOAP web service provides an interface for retrieving documents and data. Security
Scenario : I'm currently trying to build a poor man's Google Maps using scripts

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.