Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2005, 11:17 AM
Registered User
 
Join Date: Sep 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Windows Service will not create event messages

I have created a windows service and have it installed. When I try to start the service, I get a message box named JIT Debugging with a message stating that access is denied. Then another message box stating the service could not be started.

My service is create with this code to create the event log.
    Public Sub New()
        MyBase.New()

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

        ' Add any initialization after the InitializeComponent() call
        If Not EventLog.SourceExists("AdminReportSource") Then
            EventLog.CreateEventSource("AdminReportSource", "AdminReportLog")
        End If
        eLog.Source = "AdminReportSource"
        eLog.Log = "ReportLog"
    End Sub

Then in the OnStart sub, I try to write out a message.
    Protected Overrides Sub OnStart(ByVal args() As String)
        eLog.WriteEntry("AdminReportService Started.")
    End Sub

If I comment out WriteEntry, the services starts. Why am I unable to create event messages?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Impersonate with windows service for Service A/C vinod_yadav1919 C# 0 October 18th, 2008 02:29 PM
Create memory structure for receiving messages remya1000 .NET Framework 1.x 3 March 6th, 2008 04:30 PM
Accessing Windows service from a windows app sajid08 C# 1 October 6th, 2006 10:25 AM
Service to detect a WM_ message event sencee C# 1 April 24th, 2006 02:25 AM
How to create TCPListener windows service usingC# baqer C# 0 September 24th, 2003 08:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.