Solved

Windows Service Error 1083

Posted on 2014-02-26
2
528 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 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