We created a Windows Service with J#. The service will start OK on
computers that are a member of a domain, but when we try to start it on a
server that is configured for a workgroup we get the following error in the
event log:
Event ID: 7001
Description: The {Service Name}service depends on the Net Logon service
which failed to start because of the following error:
The service has returned a service-specific error code.
When checking the Net Logon service, we noticed that it did not start
because of the following error in the event log:
Event ID: 3095
Description: This Windows NT computer is configured as a member of a
workgroup, not as a member of a domain. The Netlogon service does not need
to run in this configuration.
Does this mean we can't run .NET Services on any box that is not a member of
a domain?.. I sure hope not!..
Please, please, please someone give me a fix for this.
Thanks,
Bryan
Bryan - 05 Feb 2004 20:12 GMT
Ok, here is the deal... It will work if you set the
serviceProcessInstaller's account set to "LocalSystem". If you have it set
to user, the service will install, but it cannot be started. We are
suspecting that is why it is trying to use the NetLogon service.
The fix we came up with was to set the account to "User", and in the
ProjectInstaller.cs, we added the following code in the
InitializeComponent() function:
String ComputerName = "";
try
{
RegistryKey rkey =
Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\Comput
erName\\ComputerName");
ComputerName = (String)rkey.GetValue("ComputerName", "unknown");
} catch(Exception e) {
System.Console.WriteLine("Error retrieving Computer Name from local
registry. " + e.Message);
}
this.serviceProcessInstaller1 = new
System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account =
System.ServiceProcess.ServiceAccount.User;
this.serviceProcessInstaller1.Password = "somepassword";
this.serviceProcessInstaller1.Username = ComputerName + "\\someusername";
We ran into issues between Windows NT and Windows 2000 that is why we are
having to use the local computer name... Using \\computername worked on
Windows 2000, but did not work on Windows NT. Using the physical computer
name solved the problem.
> We created a Windows Service with J#. The service will start OK on
> computers that are a member of a domain, but when we try to start it on a
[quoted text clipped - 21 lines]
> Thanks,
> Bryan