By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,458 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,458 IT Pros & Developers. It's quick & easy.

A small problem getting my service to work

P: n/a
Hi chaps,

I've made a pretty simple service in c# using VS.net. It compiles correctly
and I've followed what little documentation there is to create a setup
project in order to install the service.

When I try to do the install, everything seems to go well apart from right
at the end, it asks me for a account name and a password.

I'm not sure what to give it. I've tried my own account and I've tried
making an entirely new account just for this purpose but it doesnt work
either.

Does anyone know what its wanting? Is there any way I can even get it to
stop asking altogether?

Thanks

Simon
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
/// This shows how to define a specific user account to be used for the
Service
/// (in ProjectInstaller.cs file)

private void InitializeComponent()
{
this.serviceProcessInstaller1 = new
System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account =
System.ServiceProcess.ServiceAccount.User;
this.serviceProcessInstaller1.Password = "myPswd";
this.serviceProcessInstaller1.Username = Environment.MachineName +
@"\myServiceAccount";
//
// serviceInstaller1
...


/// Or you can use the local System account to run your service. With this
account, you are
/// a priviledged user for your local machine but can hardly access remote
ressources

private void InitializeComponent()
{
this.serviceProcessInstaller1 = new
System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account =
System.ServiceProcess.ServiceAccount.LocalSystem;
//
// serviceInstaller1
.......

By the way, there is a nice article about Service at:
http://www.dotnetcoders.com/web/Arti...spx?article=32
Josť
"Simon Harvey" <si**********@the-web-works.co.uk> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
Hi chaps,

I've made a pretty simple service in c# using VS.net. It compiles correctly and I've followed what little documentation there is to create a setup
project in order to install the service.

When I try to do the install, everything seems to go well apart from right
at the end, it asks me for a account name and a password.

I'm not sure what to give it. I've tried my own account and I've tried
making an entirely new account just for this purpose but it doesnt work
either.

Does anyone know what its wanting? Is there any way I can even get it to
stop asking altogether?

Thanks

Simon

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.