Installing Windows Service
-
Hi, i'm writing a windows service nad it wroked very well in C#, the problem is that it runs unser the LocalSystem acount and i want to run it under a specific User acount in the network, but whenever i chose this option the Service is failed to be installed, i use the "installutil.exe" that comes with the .NET and when i ask to install the service it shows a login dialog that asks for the username and password, and i enter a valid user name and password in the domain ( which is my account!!!) but still it keep fails to install and it rollback! does anyone have a solution for this problem?
-
Hi, i'm writing a windows service nad it wroked very well in C#, the problem is that it runs unser the LocalSystem acount and i want to run it under a specific User acount in the network, but whenever i chose this option the Service is failed to be installed, i use the "installutil.exe" that comes with the .NET and when i ask to install the service it shows a login dialog that asks for the username and password, and i enter a valid user name and password in the domain ( which is my account!!!) but still it keep fails to install and it rollback! does anyone have a solution for this problem?
-
Did you set the account you want your service to use, "log on as service" rights. If not, you'll need to do this manually in the "Local Security Policy" MMC Console.
thanks for your help, it wasn't actully the problem but your way helped find it, i was it seems i wasn't writing my user name in the way that should be, Domain\UserName. thx again.
-
Did you set the account you want your service to use, "log on as service" rights. If not, you'll need to do this manually in the "Local Security Policy" MMC Console.
can i ask another question, ow if i want to change the user name name and password from the code (since i'm bilding a controller for the service) i can stop and start and query the service but i need to have control on changing the User name and Password, so do you know or any other how can i do it in C#?
-
can i ask another question, ow if i want to change the user name name and password from the code (since i'm bilding a controller for the service) i can stop and start and query the service but i need to have control on changing the User name and Password, so do you know or any other how can i do it in C#?
There are a few Articles here on CP in the C# section dealing with that, just search "service". Here is an example: http://www.codeproject.com/csharp/CSharpWindowsServiceInst.asp