.NET Questions (CLOSED)

Questions and Answers on any aspect of .NET. Now closed.

This discussion group is now closed.

Have a question about .NET development? Try stackoverflow.com, a worldwide community of great developers asking and answering questions 24 hours a day.

The archives of .NET Questions contain years of Q&A. Even older .NET Questions are still online, too.

Windows Service in .Net 2005

Hi guys!

I need to write windows service in C# using .Net 2005 that would work as a simple task scheduler. It will take application name from xml configuration file and run that application at given time.

I tried to look it up online but I could'nt find working example.
Please let me know if you know any good web page with something like that. Or even better if u have some working example of win service under .Net 2005 that would be great

Thanks a lot
Pera Jaksic Send private email
Monday, July 10, 2006
This just screams homework assignment.
Monday, July 10, 2006
its not homework assigment..
its something i need..
school is done over the summer..
just want to get some exp with service..
and microsoft gives documentation worth ...

so if you can help help if u dont want pls ignore post
Pera Jaksic Send private email
Monday, July 10, 2006
Do a Google for "ServiceBase class" you'll get the MSDN entry.  Read up on this and you'll have all you need to know.  Creating a subclass of this is fairly trivial.  The hard work is doing whatever you intend to in this service.

Once you get the ServiceBase subclass working you'll need to read up on .NET Installers.  Do a Google for "Installer class" and read up on this as well.  Again, very straight forward and fairly trivial.  Using these keywords you can find working examples all over the web.
A programmer near the end
Monday, July 10, 2006
As it happens, I wrote something very similar just yesterday.

As someone else pointed out, this looks a little like a homework assignment or something. If you have specific questions, or need advice or help with a specific piece of your problem, let us know.
redeye Send private email
Tuesday, July 11, 2006
Have you never heard of a timer?
Tuesday, July 11, 2006
where can i find


it say just to go in /bin folder and typ installutil Service.exe

but it says
InstallUtil is not recognized as an internal or external command
Pera Jaksic Send private email
Tuesday, July 11, 2006
There is a project template for this..

Fire Up Visual Studio 2005 -> File | New Project.. menu - > C# -> Windows -> Windows Service project.

Afterwards look in the included Visual Studio help as there are a few topics on creating a windows service - maybe even a quick start tutorial.
Green Eggs and Ham Send private email
Tuesday, July 11, 2006
Follow Green Eggs and Ham's advice about just using the project template. Then look at the System.Diagnostics.Process class for how to start a program from .NET. The rest is just configuration, installation, and timing.
Tuesday, July 11, 2006
And you might also consider just using the built in Windows Task Scheduler component of the OS. Just config what the application is and a time and you got what you need. By the way, the Windows Task Scheduler is exactly what you are attempting to build. Why reinvent the wheel?
Tuesday, July 11, 2006

You need to add the path to the installutil.exe to your path environment variable (or call it directly).

<OS disk>:\<Windows directory>\Microsoft.NET\Framework\<version>
Wednesday, July 12, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz