473,550 Members | 2,406 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 1653
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
894
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
4120
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
13064
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
1035
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
7563
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
7490
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7765
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
7520
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
7846
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...
0
6104
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3519
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1096
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
802
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.