I'm an ASP.Net sorta guy, but had to write a Windows app a while back. Now they want it to run as a service. I'm clueless.
I found a couple dozen examples of service skeletons, and I think they all originated with a MS post and everyone just copied that original one.
My skeleton runs fine and responds to Start and Stop in the Services Console. But when I put a call in to one of my classes, I'm just guessing where it should go.
I put the call to my stuff in OnStart, but my service never starts completely. I get:

I saw an MS note that said:

So knowing that I cannot have long-running code in OnStart, where (and how) do I call my stuff?
I apologize for the probably-obvious question, but I've got WAY too many hours in this and I've got to move on.
Thanks in advance,
Brad
Here's what I've got...:
namespace TeknoMLA
{
classProgram : ServiceBase
{
staticvoid Main(string[] args)
{
ServiceBase.Run(newProgram());
}
public Program()
{
this.ServiceName = "TeknoMLA";
}
protectedoverridevoid OnStart(string[] args)
{
base.OnStart(args);
TeknoMain.TeknoMLA_Main(); //this is the call to my class
}
protectedoverridevoid OnStop()
{
base.OnStop();
}
}//class
}//namespace
I found a couple dozen examples of service skeletons, and I think they all originated with a MS post and everyone just copied that original one.
My skeleton runs fine and responds to Start and Stop in the Services Console. But when I put a call in to one of my classes, I'm just guessing where it should go.
I put the call to my stuff in OnStart, but my service never starts completely. I get:

I saw an MS note that said:

So knowing that I cannot have long-running code in OnStart, where (and how) do I call my stuff?
I apologize for the probably-obvious question, but I've got WAY too many hours in this and I've got to move on.
Thanks in advance,
Brad
Here's what I've got...:
namespace TeknoMLA
{
classProgram : ServiceBase
{
staticvoid Main(string[] args)
{
ServiceBase.Run(newProgram());
}
public Program()
{
this.ServiceName = "TeknoMLA";
}
protectedoverridevoid OnStart(string[] args)
{
base.OnStart(args);
TeknoMain.TeknoMLA_Main(); //this is the call to my class
}
protectedoverridevoid OnStop()
{
base.OnStop();
}
}//class
}//namespace