Solved

Windows Service Error 1083

Posted on 2014-02-26
2
573 Views
Last Modified: 2014-02-26
Hi Experts

I am being tasked with building an automatic CSV writer to pull information from a database and write to CSV file.

I have created a Windows Service, and installer however, when i go to run the Service is fails with the error


Windows could not start the CSV Writer - Neo to TwoFour service on local computer
error 1083:
the executable program that this service is configured to run does not implement the service.

service
Imports System
Imports System.Timers
Imports System.ServiceProcess
Imports System.IO
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports System.Text
Imports System.Configuration

Public Class Service1
    Inherits ServiceBase
    Private serviceTimer As Timer

    Dim sqlconn As New SqlConnection
    Dim connstr As String
    Dim sqldr As SqlDataReader
    Dim sqlstr As String
    Dim Frequency As Integer = 10000


    Public Sub New()
        ServiceName = "wsCSVWriter"
        CanStop = True
        CanPauseAndContinue = True
        CanHandleSessionChangeEvent = True
        AutoLog = True


        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub WriteLogEntry(ByVal sender As Object, ByVal e As ElapsedEventArgs)

        serviceTimer.Stop()
        EventLog.WriteEntry("CSVWriter Service active : " & e.SignalTime)
        ' Restart the timer.
        serviceTimer.Start()
    End Sub

    Protected Overrides Sub OnStart(ByVal args() As String)
        ' Obtain the interval between log entry writes from the first
        ' argument. Use 5000 milliseconds by default and enforce a 1000
        ' millisecond minimum.
        Dim interval As Double
        Try
            interval = Double.Parse(args(0))
            interval = Math.Max(1000, interval)
        Catch ex As Exception
            interval = 5000
        End Try
        EventLog.WriteEntry(String.Format("CSVWriter Service starting. Writing log entries every {0} milliseconds...", interval))
        ' Create, configure and start a System.Timers.Timer to
        ' periodically call the WriteLogEntry method. The Start
        ' and Stop methods of the System.Timers.Timer class
        ' make starting, pausing, resuming, and stopping the
        ' service straightforward.
        serviceTimer = New Timer
        serviceTimer.Interval = interval
        serviceTimer.AutoReset = True
        AddHandler serviceTimer.Elapsed, AddressOf WriteLogEntry
        serviceTimer.Start()




    End Sub

    Protected Overrides Sub OnStop()
        EventLog.WriteEntry("CSVWriter Service stopping...")
        serviceTimer.Stop()
    End Sub

End Class

Open in new window


project installer

Imports System.ComponentModel
Imports System.Configuration.Install
Imports System.ServiceProcess

Public Class ProjectInstaller
    Inherits Installer



    Public Sub New()
        MyBase.New()

        'This call is required by the Component Designer.
        InitializeComponent()

        'Add initialization code after the call to InitializeComponent
        Dim ServiceExampleProcess As New ServiceProcessInstaller
        ServiceExampleProcess.Account = ServiceAccount.LocalSystem
        ' Instantiate and configure a ServiceInstaller.
        Dim ServiceExampleInstaller As New ServiceInstaller
        ServiceExampleInstaller.DisplayName = "CSV Writer - Neo to TwoFour"
        ServiceExampleInstaller.ServiceName = "wsCSVWriter.exe"
        ServiceExampleInstaller.StartType = ServiceStartMode.Automatic
        Installers.Add(ServiceExampleInstaller)
        Installers.Add(ServiceExampleProcess)

    End Sub

    Private Sub ServiceInstaller1_AfterInstall(sender As Object, e As InstallEventArgs) Handles ServiceInstaller1.AfterInstall

    End Sub
End Class

Open in new window


any and all help appreciated
0
Comment
Question by:SimonPrice33
2 Comments
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 500 total points
ID: 39891104
Hi,

Change this line in the installer class:
ServiceExampleInstaller.ServiceName = "wsCSVWriter.exe"

Open in new window

to this:
ServiceExampleInstaller.ServiceName = "wsCSVWriter"

Open in new window


You have set different service name in the service class and installer class.

Regards,
Mishu
0
 

Author Closing Comment

by:SimonPrice33
ID: 39891137
thank you, I have resolved the issue now :)
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question