473,698 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service startup error


I have created a windows service based on a walkthrough in the MSDN
library
(ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio .v80.en/dv_radcon/html/e24d8a3d-edc6-485c-b6e0-5672d91fb607.ht m
- Creating a Windows Service Application in the Component Designer)

But when I start the service I get a Unhandled
System.Security .SecurityExcept ion and then the Error: 1053 popup.

If I'm quick with the debugger I get an exception on:

if (!System.Diagno stics.EventLog. SourceExists("M ySource")){

of:

System.Security .SecurityExcept ion was unhandled
Message="The source was not found, but some or all event logs could
not be searched. Inaccessible logs: Security."
Source="System"
StackTrace:
at System.Diagnost ics.EventLog.Fi ndSourceRegistr ation(String
source, String machineName, Boolean readOnly)
at System.Diagnost ics.EventLog.So urceExists(Stri ng source,
String machineName)
at System.Diagnost ics.EventLog.So urceExists(Stri ng source)
at MyNewService.My NewService..cto r()
at MyNewService.My NewService.Main ()

Any ideas what is causing this? and/or how to fix it.

Cheers,
Nick
Feb 9 '06 #1
0 1243

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2886
by: Stefan Hinz | last post by:
Degan, jumping in to try and solve some problems that look pretty obvious to me ... > #options for default service (mysqld2) > (mysqld2) It should be , not (mysqld2).
4
15886
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group : microsoft.public.dotnet.languages.csharp URL :...
3
14927
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim swLog As StreamWriter = File.CreateText("C:\myLog.txt") swLog.WriteLine("My Windows Service has just started.") swLog.Close() : swLog.Flush() End Sub
4
2101
by: duzinga | last post by:
I am trying to have a server program that runs at startup and accepts several commands from the clients. One of the commands is to play an audio file. I am using Microsoft.DirectX.AudioVideoPlayback.Audio class for that purpose. My problem is whenever I send a command to the program windows gives an error related to the directX, and shuts down the program. However if I run the program manually after the startup it works just fine. I have...
1
3696
by: Sergey Krutous | last post by:
Can you please help me to resolve the following issue: I developed a windows service. At start up (I have overriden OnStart method) it connects to a web service and if the connection fails the windows service sets ExitCode property to non-zero value (55) and calls Stop method. If this happens when user starts the service in Services snap-in SCM shows error massage and service stops - it's OK. I configured automatic startup and Recovery...
4
4178
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to check to see if the status is in stopped or running mode. But that doesn't tell me if it is actually running. I need to know this so that if it happens I can programmatically start the same service on another machine.
4
1981
by: Ashley Bryant | last post by:
I've created a Windows Service in vb.net that is set up to run automatically, but it never starts during system startup. I can start it manually, but I need the service to start without any user interaction. When I originally installed the service, I had to attempt the start twice as well from the Service Manager. So, for some odd reason, it has to be told twice to start. I get the following errors in the System log at startup: ...
1
6413
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... After I installed my .net windows service, I tried to control some of the behavior with the Start Parameters: in the services control parameter. I can put a value in the box but for some reason it never gets saved (I open the properties right after, and the box is empty). How does one persist a value in the Start Parameters box for a service? Thanks
7
13371
by: =?Utf-8?B?Sm9obi5ORVQ=?= | last post by:
Hi I have written a windows service in C# / .NET I have installed it and it's working fine on a couple boxes but on my XP box I get this error when I try to start it: Error 1053: The service did not respond to the start or control request in a timely fashion. I understand that the scm issue the start and is supposed to put up this error after some timeout period but it's coming up after only about half a second and it doesnt even...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.