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 6825587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:03:04+00:00 2026-05-26T22:03:04+00:00

Im trying to create a windows service with vb.net but when I run: InstallUtil.exe

  • 0

Im trying to create a windows service with vb.net but when I run:

InstallUtil.exe myservice.exe

I’m getting the following error in the MyService.InstallLog file:

Restoring event log to previous state for source DebtorInvoiceMailingService.
An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully

DebtorInvoiceMailingService.vb

Imports System.ServiceProcess
Imports System.Timers

Public Class DebtorInvoiceMailingService
    Inherits ServiceBase
    Private _timer As Timer
    Private _lastRun As DateTime = DateTime.Now
    Private _notificationsManager As Notifications

    Public Sub New()
        Me.ServiceName = "DebtorInvoiceMailingService"
    End Sub

    'When service starts
    Protected Overrides Sub OnStart(ByVal args() As String)
        MyBase.OnStart(args)
        'This object will do what im looking for (monitore a folder)
        Me._notificationsManager = New Notifications
        Me._timer = New Timer
        'Service will be executed every 24 hours
        Me._timer.Interval = 1000 * 60 * 60 * 24
        Me._timer.Enabled = True
        'Service will execute timer_Elapsed()
        AddHandler Me._timer.Elapsed, AddressOf timer_Elapsed
    End Sub

    'When service stops
    Protected Overrides Sub OnStop()
        MyBase.OnStop()
        Me._timer.Dispose()
    End Sub

    'Function executed every 24 hours
    Private Sub timer_Elapsed(ByVal sender As Object, ByVal e As ElapsedEventArgs)
        If (Me._lastRun.Date > DateTime.Now.Date) Then
            Me._timer.Stop()
            'You have to stop your timer because if the task that you 
            'are about to perform takes longer than the timer.interval
            'the task will be executed multiple times
            Me._notificationsManager.execute() 'this function will send an email
            Me._lastRun = DateTime.Now
            Me._timer.Start()
        End If
    End Sub

    Shared Sub Main()
        ServiceBase.Run(New DebtorInvoiceMailingService)
    End Sub
End Class

ProjectInstaller.vb

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

<RunInstallerAttribute(True)> _
Public Class ProjectInstaller
    Inherits System.Configuration.Install.Installer
    Public WithEvents ServiceProcessInstaller1 As ServiceProcessInstaller
    Public WithEvents ServiceInstaller1 As ServiceInstaller

    Public Sub New()
        MyBase.New()
        Me.ServiceProcessInstaller1 = New ServiceProcessInstaller()
        Me.ServiceInstaller1 = New ServiceInstaller()
        'ServiceProcessInstaller1
        Me.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem
        Me.ServiceProcessInstaller1.Password = Nothing
        Me.ServiceProcessInstaller1.Username = Nothing
        'ServiceInstaller1
        Me.ServiceInstaller1.Description = "Auto mailing invoices to debtors every 24 hours."
        Me.ServiceInstaller1.DisplayName = "DebtorInvoiceMailingService"
        Me.ServiceInstaller1.ServiceName = "DebtorInvoiceMailingService"
        Me.ServiceInstaller1.StartType = ServiceStartMode.Manual
        'ProjectInstaller
        Me.Installers.Add(Me.ServiceProcessInstaller1)
        Me.Installers.Add(Me.ServiceInstaller1)
    End Sub

Please Can someone help me? 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-26T22:03:04+00:00Added an answer on May 26, 2026 at 10:03 pm

    Be sure to run the InstallUtil from a command windows launched “As Administrator”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to deploy a windows service but not quite sure how to do
I am trying to create a WiX installer for a Windows service, and I
I'm trying to debug a web service (Windows XP SP3, VS 2008, ASP.NET 2,
I am trying to create and install a .NET app on a windows server
I am new to WCF, trying to create a .net WCF service app. i
I'm trying to create an XML-RPC server as a windows service. The XML-RPC server
I'm a Silverlight/ASP.NET developer trying to write my first Windows Forms application to run
I've been trying to create a Windows Media Player plugin in Visual Studio 2008,
Is there a way I can create Windows firewall exceptions in VB2005? I'm trying
I'm trying to create a c++ library for use on windows/MSVC. My problem is

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.