Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / February 2004

Tip: Looking for answers? Try searching our database.

Cannot start Service on a server configured as a member of a workgroup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bryan - 05 Feb 2004 16:41 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.