2

I own a copy of Visual Studio 2008 Standard Edition, and I'd like to create a Windows Service. However, I don't have a Windows Service project template. According to this chart, Standard Edition should be able to create Windows Services. I tried running devenv.exe /InstallVSTemplates, but I don't seem to have any of the Windows Service templates (which is probably why the devenv command didn't work).

Does anyone know how I can get the templates?

Mike Pateras
  • 14,715
  • 30
  • 97
  • 137
  • 1
    You can create a service without the template as well. – Tim Feb 16 '10 at 14:54
  • 2
    Sometimes I wonder why people ask here before googling... Here's the very first result from searching `"visual studio 2008 standard" services`: http://justinjmoses.wordpress.com/2008/03/27/visual-studio-2008-standard-vs-professional/ – Cogwheel Feb 16 '10 at 14:55
  • 1
    @Cogwheel: Your top-voted question and answer are your own self-promotion (http://stackoverflow.com/questions/1515399/can-you-make-custom-operators-in-c) and you still have a problem with people asking genuine questions, even if they are basic? –  Feb 16 '10 at 15:15
  • I did Google first. I always do. I tried '"Visual Studio 2008 Standard Edition" "Windows Service"', as well as a few others. I didn't find anything as helpful as the link you posted, though. I guess I was too specific. – Mike Pateras Feb 16 '10 at 15:51
  • 2
    @Mike: It's a common problem that once you know the correct answer, it's easy to write a search that finds it. There was evidence that you'd actually tried because you told us what didn't work; there was no call for the insulting tone in the other comment. Posting that URL as an answer would've been appropriate, however. –  Feb 16 '10 at 15:54
  • Wow... Sure there was some snark in my comment, but I think you're over-reacting a bit here, @Roger Pate. @Mike Pateras, I'm sorry if my comment came across as insulting as Roger seems to have taken it. – Cogwheel Feb 16 '10 at 16:04
  • @Roger Pate: wow you really got a stick up your butt about this one. You really down voted my other question/answer because of some personal vendetta against me? Luckily for my sense of irony I care far less about my rep SO rep than you seem to (if I did care, I would indeed have posted that link as an answer) – Cogwheel Feb 16 '10 at 16:07
  • @Cogwheel: No, I down-voted it because it's self-promotional spam. –  Feb 16 '10 at 18:05
  • 1
    Umm ... ok... It's also community wiki, and I mentioned someone else's project first. – Cogwheel Feb 16 '10 at 19:25

2 Answers2

2

It seems that not including the template in the Standard edition was an oversight on Microsoft's part. Check out this Microsoft forum thread where someone was kind enough to post the template that you then simply install with devenv /installvstemplates

Epaga
  • 38,231
  • 58
  • 157
  • 245
1

You don't need the templates. Just create a class that inherits from ServiceBase and in your Main() method call ServiceBase.Run().

You can use a console project and use command line options or Debugger.IsAttached to decide whether to run as a service or not.

Samuel Neff
  • 73,278
  • 17
  • 138
  • 182