473,480 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What's missing in this service?

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.");
}
}
}
--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 3 '08 #1
4 1648
Hi

The class with the class-level attribute RunInstaller(true) is the installation class for your service.
This is the class responsible for registrering the service(s) with the SCM (Service Control Manager) and writing entries into Registry in Windows.

There is no need to create a custom installer if you do not have special requiremens during the installation process, which I sense you do not.
Add a ordinary installer via your control-designer surface and it will work.

/Claus Konrad
"K Viltersten" <tm**@viltersten.comwrote in message news:6i************@mid.individual.net...
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.");
}
}
}
--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.

Sep 3 '08 #2
To add an installer:
Right-click on your service and press "Add Installer". This will add the installer class to your service and this very installer class will carry the RunInstaller(true) attribute for your. You do not need to worry about these things though. Just add the installer and you should be fine...

/Claus Konrad
"K Viltersten" <tm**@viltersten.comwrote in message news:6i************@mid.individual.net...
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.");
}
}
}
--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.

Sep 3 '08 #3
On Sep 3, 7:45*am, "K Viltersten" <t...@viltersten.comwrote:
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.");
* * }
* }

}

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Hi,

Right click in the design panel of your service and select Add
Installer.
Then add a setup project to your solution, add the primary output of
your service.
I know there is another step, adding a custom action maybe?? Let me
check ...
Sep 3 '08 #4
The class with the class-level attribute RunInstaller(true) is the installation class for your service.
This is the class responsible for registrering the service(s) with the SCM (Service Control Manager) and writing entries into Registry in Windows.

There is no need to create a custom installer if you do not have special requiremens during the installation process, which I sense you do not.
Add a ordinary installer via your control-designer surface and it will work.

According to
http://msdn.microsoft.com/sv-se/libr...us,VS.80).aspx
i should see [RunInstallerAttribute(true)] and not the
one you mentioned. What's up with that?

--
Regards
Konrad Viltersten
----------------------------------------
May all spammers die an agonizing death;
have no burial places; their souls be
chased by demons in Gehenna from one room
to another for all eternity and beyond.
Sep 3 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
890
by: Srinivas M | last post by:
Hello, I am developing VC application (ATL), that communicates with web service, with NTLM authentication. following is the code sinppet i have, Auth Object derived from IAuthInfo to supply...
3
7632
by: Harry Simpson | last post by:
Windows Server 2003 is supposed to include Framework 1.1 right. I don't have it here but have reports that the web is not running. The users say that the %COMPUTERNAME%\ASPNET user doesn't exist....
0
914
by: Mark Shehan | last post by:
I am using VS2005 and ASP.NET 2 I want to use IIS to host some .NET remoting. I have a website I created called RemotingHost. I created another class project called RemotingServer and in there...
0
4104
by: John Jenkins | last post by:
Hi, any help on this would be greatly apprciated. I have been given a wsdl file from a customer generated by Oracle 10g Web Services tools. When I use wsdl.exe to attempt to produce proxy classes I...
3
13058
by: musosdev | last post by:
Hi guys I've just noticed I don't have an ASPNET user account running on either my Workstation or Server (both running .net2.0, workstation has vs2005 pro). Simple question... should it be...
0
4805
by: Jigar.Patel | last post by:
I have simple remoting server exposing following simple method. When I try to add webreference to this server in another project, it gives me following error: Custom tool error: Unable to import...
0
1028
by: MSDN | last post by:
Hello, When I go to create a New Windows-Service Project, using VS.NET 2005 Standard Addition , I can not find the Windows Service Template. I can see it in VS.NET 2003 Am I missing...
7
6731
by: Billy Angers | last post by:
My server is running under Windows SBS 2003. I've deleted some directories that was containing Outlook Web Access files, it was done few months ago by mistake. Now I want to use OWA for some...
2
1553
by: huohaodian | last post by:
Hi, I am a new to web service world. For the leaning purpose, I have created a web service in 2005 with one asmx.cs file, in this file, I have one method called GetUser() which returns a custom...
0
7088
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5342
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4485
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2986
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
183
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.