473,545 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ 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 RunInstallerAtt ribute.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.ServiceNam e = "PageroLink ";
this.CanStop = true;
this.CanPauseAn dContinue = true;
this.CanShutdow n = true;
this.CanHandleP owerEvent = false;
}
public static void Main()
{
ServiceBase.Run (new ServiceRunner() );
}
protected override void OnStart(string[] args)
{
Console.WriteLi ne("Service commenced.");
}
protected override void OnStop()
{
Console.WriteLi ne("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 1651
Hi

The class with the class-level attribute RunInstaller(tr ue) 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**@vilterste n.comwrote in message news:6i******** ****@mid.indivi dual.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 RunInstallerAtt ribute.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.ServiceNam e = "PageroLink ";
this.CanStop = true;
this.CanPauseAn dContinue = true;
this.CanShutdow n = true;
this.CanHandleP owerEvent = false;
}
public static void Main()
{
ServiceBase.Run (new ServiceRunner() );
}
protected override void OnStart(string[] args)
{
Console.WriteLi ne("Service commenced.");
}
protected override void OnStop()
{
Console.WriteLi ne("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(tr ue) 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**@vilterste n.comwrote in message news:6i******** ****@mid.indivi dual.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 RunInstallerAtt ribute.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.ServiceNam e = "PageroLink ";
this.CanStop = true;
this.CanPauseAn dContinue = true;
this.CanShutdow n = true;
this.CanHandleP owerEvent = false;
}
public static void Main()
{
ServiceBase.Run (new ServiceRunner() );
}
protected override void OnStart(string[] args)
{
Console.WriteLi ne("Service commenced.");
}
protected override void OnStop()
{
Console.WriteLi ne("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...@vilterste n.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 RunInstallerAtt ribute.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.ServiceNam e = "PageroLink ";
* * * this.CanStop = true;
* * * this.CanPauseAn dContinue = true;
* * * this.CanShutdow n = true;
* * * this.CanHandleP owerEvent = false;
* * }
* * public static void Main()
* * {
* * * ServiceBase.Run (new ServiceRunner() );
* * }
* * protected override void OnStart(string[] args)
* * {
* * * Console.WriteLi ne("Service commenced.");
* * }
* * protected override void OnStop()
* * {
* * * Console.WriteLi ne("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(tr ue) 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 [RunInstallerAtt ribute(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
893
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 user,passwd information. However, i receive HTTP 1.1 401 (Unauthorized access). error....
3
7641
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. Questions: 1. is this user replaced by the %COMPUTERNAME%\NETWORK SERVICE user in Windows 2003 Server (IIS6)? 2. if the ASPNET user still...
0
919
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 a class called TestClass (inherits Marshallbyrefobject for remoting). I then added the built assembly to the bin folder on the RemotingHost...
0
4119
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 get the following error: Error: Unable to import binding 'SubmitMessageSkeletonBinding' from namespace...
3
13063
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 there with .net2, and if so how can I create it!? Cheers
0
4820
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 WebService/Schema. Unable to import binding 'MyRemoteObjectBinding' from namespace...
0
1034
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 something. Is my VS.Net 2005 Version incorrect?
7
6746
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 distant users. So, I tried the procedure on the MS website: http://support.microsoft.com/?scid=kb%3Ben-us%3B883380&x=13&y=19 I've done all of the Method...
2
1555
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 user object, something like public User GetUser()
0
7496
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7685
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7452
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7784
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5354
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5071
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.