473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

A small problem getting my service to work

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
1 2279
/// 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nathan Kovac | last post by:
I have a feeling I am missing something simple, but I just can't find it. Perhaps someone can give me a lead on where to look. I will describe the issue then post my code to the web service. My...
0
by: Steve Richter | last post by:
Will my PC be able to use the SMTP service to send email? The PC is w2k, the SMTP service is started. My PC is on a lan, connects to a LinkSys router, the router is connected to the DSL modem,...
3
by: Miriam | last post by:
Hello, I created a Windows Service in VB.NET, which is to purge files periodically in the local system and also in the shared network drive. Here is my problem: 1. If I set the “Accountâ€...
2
by: russ.haley | last post by:
I have created a small windows service in C# that installs using the service installer classes and a deployment project. I have been able to install the service but the uninstallation does not...
2
by: ImOk | last post by:
WHen I run this under Windows I get the Count of drives but then I get an error message on the Reset() when I try to enumerate. Does this work for anyone? $fs = new...
13
by: John Kotuby | last post by:
I am expecting the answer to be, "of course not" or " are you kidding?", but maybe (hopefully) I am wrong and somebody can point me to an ingenious example of how the impossible just takes a little...
0
by: RandyH | last post by:
Hello, I can do do this in the page load when NOT using a formview, but how can I do this with a formview control??? Me.btnReturn.Attributes.Add("onclick", "history.back();return false")
4
by: smdreger | last post by:
I have several email fields in my Customer Contact database. The fields are set up as hyperlinks. When I enter an email address for the customers they appear as a hyperlink. When I click on them...
2
by: adminravi | last post by:
Hi, I have just learnt visual C++ 6.0 and I m comfortable with programming. I want to know if there are any API's that I can use to build some project. I want to work on a small project to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.