Visual Studio 2008 will not let you Debug a windows service. In the Project Properties, in the Debug tab, put [some command line argument...like /c for console]. This will send a command line argument to your application.
Surround the
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new MainDataService()
};
ServiceBase.Run(ServicesToRun);
With an
if(commandLineArg == "/c")
{
[code above]
}
This will run your application in Visual Studio
No comments:
Post a Comment