Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows Service Error 1083

Posted on 2014-02-26
2
Medium Priority
?
705 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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

721 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