简体   繁体   中英

Cannot start service from the command line or debugger. How can I tell which service?

I am trying to debug an ASP VB web site project I recently took over.

I start debug while in the home page.

I recieve the following error:

Cannot start service from the command line or debugger. A windows Service must first be installed(using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.

How do I tell what service the program is trying to start?

I viewed other questions with this error to no avail.

Thanks!

You're trying to debug not an ASP/ASP.NET application, but a Windows Service project - it cannot start from the debugger. If your solution has multiple projects, make sure to set Startup project to the one you're working with.

If you do need to debug the service, compile and install it as the message suggest and then attach Visual Studio debugger to the process running the service.

You are trying to start a window service from vs.net.You have to start the application as a service and the attach the debugger. You can make extra project, commandline with:

public static int Main(string[] args)
{
    // Startup as application
}

to start the serice as a commandline application.

Or you can add a brakpoint in de service to attach the debugger with:

Debugger.Break() 

Configure and starting a service

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM