K
K Viltersten
I've followed the section on MSDN on how to
create a service but it seems that when i
install it, i get an error about an
attribute named RunInstallerAttribute.Yes
missing.
As far i haven't seen any info on that for
a basic case of a service. Where should it
go and what does it look like?
namespace MySpace
{
class ServiceRunner : ServiceBase
{
ServiceRunner()
{
this.ServiceName = "PageroLink";
this.CanStop = true;
this.CanPauseAndContinue = true;
this.CanShutdown = true;
this.CanHandlePowerEvent = false;
}
public static void Main()
{
ServiceBase.Run(new ServiceRunner());
}
protected override void OnStart(string[] args)
{
Console.WriteLine("Service commenced.");
}
protected override void OnStop()
{
Console.WriteLine("Service ceased.");
}
}
}
create a service but it seems that when i
install it, i get an error about an
attribute named RunInstallerAttribute.Yes
missing.
As far i haven't seen any info on that for
a basic case of a service. Where should it
go and what does it look like?
namespace MySpace
{
class ServiceRunner : ServiceBase
{
ServiceRunner()
{
this.ServiceName = "PageroLink";
this.CanStop = true;
this.CanPauseAndContinue = true;
this.CanShutdown = true;
this.CanHandlePowerEvent = false;
}
public static void Main()
{
ServiceBase.Run(new ServiceRunner());
}
protected override void OnStart(string[] args)
{
Console.WriteLine("Service commenced.");
}
protected override void OnStop()
{
Console.WriteLine("Service ceased.");
}
}
}