-2

When I start "F5" in a project in Visual Studio 2015, the program show me the message:

Can not you start the service from the command line or in the debugger. The windows service must be installed 's First (using installutil.exe ) and then started with ServerExplorer , the administrative tool for Windows Services or the NET START command"

How can I resolve these?

Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
Eric Saboia
  • 301
  • 2
  • 10
  • 22
  • 3
    Possible duplicate of [Run a Windows Service as a console app](http://stackoverflow.com/questions/5157176/run-a-windows-service-as-a-console-app) – Fairy Jul 13 '16 at 12:16
  • Have you even tried to use Google? It's faster than posting a question and gives you faster results. Or at the very least read the error message – Camilo Terevinto Jul 13 '16 at 12:17
  • There is a lot of documentation on this out there.. – BugFinder Jul 13 '16 at 12:18

2 Answers2

2

An alternative approach is to do it the way Windows Services were traditionally debugged.

  1. Install the service (I set up a External Tool entry in VS to do this)

  2. Run the service via the SCM

  3. Attach the debugger (VS) to the running process - perform your debugging session

  4. Stop and uninstall the service (I have a External Tool entry in VS for this as well)

Kevin
  • 1,462
  • 9
  • 9
0

Creating a Service in C# i not that easy you can follow this Link it is a complete Walkthrough on how to create a C# service and how to run/debug it.

I don't like to do this so most of the time i will just use a ConsoleApplication an hide it with this.

Community
  • 1
  • 1
Jan Wiesemann
  • 455
  • 2
  • 16