Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best guide for creating Windows Services in C# .NET? [closed]

I'm looking to convert a small .NET console application into a Windows Service. I'd like to build two versions, one using .NET 2.0 and another with .NET 3.5 .

Are there radically different approaches that need to be taken, or will the 2.0 version be roughly equivalent to the 3.5 version? Where's a good source of information (i.e. a web-based guide) that can walk me through the steps of setting up the service?

Thanks! P.A.

like image 320
Presentation Avenger Avatar asked Nov 06 '08 17:11

Presentation Avenger


2 Answers

Actually, .NET 3.5 does change the C# code a little. For example, you can use the var keyword, and you can use the hidden private variables for properties. It is still based on CLR 2.0.

There is a pretty good article at msdn that talks about windows services and walks you through building one.

like image 165
HitLikeAHammer Avatar answered Oct 18 '22 17:10

HitLikeAHammer


To supplement Rick's answer, I'd suggest the MSDN Walkthrough

It is incredibly verbose and touches on event logging as well as an installer.

like image 37
crftr Avatar answered Oct 18 '22 19:10

crftr