Tech Off Thread

6 posts

Windows Services in VS2005

Back to Forum: Tech Off
  • User profile image
    Larsenal

    I have Visual Studio 2005 Standard Edition.  When I go to create a new project, I do not see the Windows Service template.

    A) Can I download this from somewhere?
    B) Do I need to?

  • User profile image
    NuTcAsE

    Larsenal wrote:
    I have Visual Studio 2005 Standard Edition.  When I go to create a new project, I do not see the Windows Service template.

    A) Can I download this from somewhere?
    B) Do I need to?


    File->New->Web Site
    Select ASP.Net Web Service from dialog.

    - nutcase

  • User profile image
    Jazzynupe

    When you pick new project, click on the language (C# or VB) then expand the options and select Windows (all this on the new Project dialog). When you do that the option for a Windows service shows up.

  • User profile image
    Larsenal

    NuTcAsE wrote:
    Larsenal wrote:I have Visual Studio 2005 Standard Edition.  When I go to create a new project, I do not see the Windows Service template.

    A) Can I download this from somewhere?
    B) Do I need to?


    File->New->Web Site
    Select ASP.Net Web Service from dialog.

    - nutcase


    Windows Service

  • User profile image
    Larsenal

    Jazzynupe wrote:
    When you pick new project, click on the language (C# or VB) then expand the options and select Windows (all this on the new Project dialog). When you do that the option for a Windows service shows up.


    That's the problem.  It doesn't show up there.  I have Standard Edition, if that has anything to do with it.

    Here are the options under Visual C# -> Windows:
    -Windows Application
    - Windows Control Library
    - Console Applicatoin
    - Class Library
    - Web Control Library
    - Empty Project

  • User profile image
    mawcc

    Are you able to do "Add -> Component... -> Windows Service" in an existing project? If so, I think you could create a console application as a starting point, add a Windows Service Component (e.g. named Service1) and do something like this in the Main method:

    using System.ServiceProcess;

    ...

    ServiceBase serviceToRun = new ServiceBase { new Service1() };
    ServiceBase.Run( serviceToRun );

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.