Solved

Windows Service Error 1083

Posted on 2014-02-26
2
668 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 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