Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Services no longer start
Message
From
11/03/2004 19:17:34
Jorge Haro
Independent Consultant
Juarez, Mexico
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Services no longer start
Miscellaneous
Thread ID:
00885450
Message ID:
00885450
Views:
52
Hi, I'm writing a service that does some periodical logging, it was working just fine, until this morning when it suddenly refused to start. While testing I would compile the service, installed and then started the service, ran the tests, stopped the service, uninstalled, changed whaterver was needed and repeated the cycle, and this was working just fine. I have now tried creating a couple of simple sevices from samples I found on the net but they will also not start. I'm getting this message when trying to start the service :

"Could not start the Service Name service on Local Computer. The service did not return an error. This could be an internal Windows Error or an internal service error, if the problem persists, contact your system administrator"

The service is set to run using the local account wich has administrative rights. This is the full code of one of the samples:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Configuration.Install;

namespace WindowsService
{
	/// <summary>
	/// This is the class for my Service
	/// </summary>
	public class MyService : System.ServiceProcess.ServiceBase
	{
		public MyService()
		{
			InitializeComponents();

			// TODO: Add any further initialization code
		}

		private void InitializeComponents()
		{
			this.ServiceName = "MyService";
		}
		
		/// <summary>
		/// This method starts the service.
		/// </summary>
		public static void Main()
		{
			System.ServiceProcess.ServiceBase.Run(new System.ServiceProcess.ServiceBase[] {
				new MyService() // To run more than one service you have to add them here
			});
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			// TODO: Add cleanup code here (if required)
			base.Dispose(disposing);
		}

		/// <summary>
		/// Start this service.
		/// </summary>
		protected override void OnStart(string[] args)
		{
			// TODO: Add start code here (if required)
			//       to start your service.
			EventLog.WriteEntry("Servicio Iniciado");
		}
 
		/// <summary>
		/// Stop this service.
		/// </summary>
		protected override void OnStop()
		{
			// TODO: Add tear-down code here (if required) 
			//       to stop your service.
			EventLog.WriteEntry("Servicio Detenido");
		}
	}
}

[RunInstallerAttribute(true)]
public class ProjectInstaller : Installer
{
	public ProjectInstaller()
	{
		ServiceProcessInstaller spi = new ServiceProcessInstaller();
		spi.Account = ServiceAccount.LocalSystem;
		ServiceInstaller si = new ServiceInstaller();
		si.ServiceName = "Hello Service Template";
		si.StartType = ServiceStartMode.Automatic;
		Installers.AddRange(new Installer[] {spi, si});
	}
}
using:
.Net Framework v1.1.4322
Windows 2000 Professional, up to date.
TIA
Next
Reply
Map
View

Click here to load this message in the networking platform