Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 506363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:41:37+00:00 2026-05-13T06:41:37+00:00

I want to create a Windows Service using VB.Net, but in VS2008 Standard, you

  • 0

I want to create a Windows Service using VB.Net, but in VS2008 Standard, you don’t seem to get the “Windows Service” template I’ve used before.

What’s the best way of creating such a service, without resorting to using the C++ template?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:41:37+00:00Added an answer on May 13, 2026 at 6:41 am

    There’s nothing really special about the Windows Service template. It creates two class files in your project and adds a reference to System.ServiceProcess:

    Service1.vb:

    Public Class Service1
    
        Protected Overrides Sub OnStart(ByVal args() As String)
            '' Add code here to start your service. This method should set things
            '' in motion so your service can do its work.
        End Sub
    
        Protected Overrides Sub OnStop()
            '' Add code here to perform any tear-down necessary to stop your service.
        End Sub
    
    End Class
    

    Service1.Designer.vb:

    Imports System.ServiceProcess
    
    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    Partial Class Service1
        Inherits System.ServiceProcess.ServiceBase
    
        ''UserService overrides dispose to clean up the component list.
        <System.Diagnostics.DebuggerNonUserCode()> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try
                If disposing AndAlso components IsNot Nothing Then
                    components.Dispose()
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub
    
        '' The main entry point for the process
        <MTAThread()> _
        <System.Diagnostics.DebuggerNonUserCode()> _
        Shared Sub Main()
            Dim ServicesToRun() As System.ServiceProcess.ServiceBase
    
            '' More than one NT Service may run within the same process. To add
            '' another service to this process, change the following line to
            '' create a second service object. For example,
            ''
            ''   ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1, New MySecondUserService}
            ''
            ServicesToRun = New System.ServiceProcess.ServiceBase() {New Service1}
    
            System.ServiceProcess.ServiceBase.Run(ServicesToRun)
        End Sub
    
        ''Required by the Component Designer
        Private components As System.ComponentModel.IContainer
    
        '' NOTE: The following procedure is required by the Component Designer
        '' It can be modified using the Component Designer.  
        '' Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> _
        Private Sub InitializeComponent()
            components = New System.ComponentModel.Container()
            Me.ServiceName = "Service1"
        End Sub
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a Windows Service using the Windows API (no .NET, no
I have a .Net Windows service. I want to create an installer to install
I want to create a Cluster Generic Service using script. We have Windows Server
I want to create windows application in c# 2008. The problem is I don't
I'm developing a service using .NET on Windows platforms. It had worked until yesterday...
I want to call a Business layer method from a Windows service (done using
I want to create a Windows Service that tracks if the A/C power adapter
I'm using cygrunsrv and autossh on windows XP to create a service building a
I want to create a Windows 7 64-bit (Ultimate) virtual machine with: Visual Studio
OK, I want to create a windows shell extention that sits in the file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.