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

Windows Service in C#

P: n/a
I've written up a service in a C# using VS.NET to create the framework for
me. However, I can't seem to get the service installed properly. When I
run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does
not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with much.

Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg
Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Ryan Gregg wrote:
I've written up a service in a C# using VS.NET to create the framework for
me. However, I can't seem to get the service installed properly. When I
run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does
not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with much.

Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg

I believe your account would need to have access permissions

--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
Nov 16 '05 #2

P: n/a
Did you add a project installer 'class' to the project itself? If you
double-click on the main service source file then the [Design] page for the
service will be defined, and a right-click on this page will reveal a menu
that will contain an "Add Installer" entry; select this and a new source
file will be added to the project. Edit that file as required and rebuild
it.

-Ken

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've written up a service in a C# using VS.NET to create the framework for
me. However, I can't seem to get the service installed properly. When I
run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does
not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with much.
Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg

Nov 16 '05 #3

P: n/a
Ken,

I already had a project installer, but I noticed when I was looking at it
again that I was using the "LocalService" account setting, instead of the
"LocalSystem" account. Since I don't beleive Windows 2000 has a
"LocalService" account setting, this is probably the cause of the problem.
After I swithed it over to LocalSystem, it seems to install and work
properly.

Thanks for your help.

Ryan Gregg
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:uG**************@TK2MSFTNGP12.phx.gbl...
Did you add a project installer 'class' to the project itself? If you
double-click on the main service source file then the [Design] page for the service will be defined, and a right-click on this page will reveal a menu
that will contain an "Add Installer" entry; select this and a new source
file will be added to the project. Edit that file as required and rebuild
it.

-Ken

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've written up a service in a C# using VS.NET to create the framework for me. However, I can't seem to get the service installed properly. When I run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with

much.

Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg


Nov 16 '05 #4

P: n/a
Well, I resolved this issue, but now I have another. I changed the service
over to run on the LocalSystem account, and that lets me install it
properly. However, when I try to actually start the service, I get the
following error:
"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've written up a service in a C# using VS.NET to create the framework for
me. However, I can't seem to get the service installed properly. When I
run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does
not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with much.
Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg

Nov 16 '05 #5

P: n/a
Arg. Let me try that again. I can install the service sucessfully now that
I'm using the LocalSystem account instead of LocalService.

However, when I try to start the service now, I get this error:

---------------------------
Microsoft Management Console
---------------------------
Could not start the TACS Runtime Service service on Local Computer.
The service did not return an error. This could be an internal Windows
error or an internal service error.
If the problem persists, contact your system administrator.

I've tried moving the service over to running as my user account to see if
there was a permissions issue involved there, and it still gives me the same
error. Is there any way to debug what is causing the service to fail to
start?

Thanks.
Ryan Gregg

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've written up a service in a C# using VS.NET to create the framework for
me. However, I can't seem to get the service installed properly. When I
run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does
not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with much.
Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg

Nov 16 '05 #6

P: n/a
Ryan,

Is your service starting the application in an independent thread? As I'm
sure you know from the docs, a service has only 30 seconds to return from
the intial method call to be considered 'started'. Usually, you can just
start the service in an independent thread so it will return immediately.
If this is not the problem, post your service OnStart, Pause, etc... and I'm
sure people will help you.

Alex

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...
Arg. Let me try that again. I can install the service sucessfully now that I'm using the LocalSystem account instead of LocalService.

However, when I try to start the service now, I get this error:

---------------------------
Microsoft Management Console
---------------------------
Could not start the TACS Runtime Service service on Local Computer.
The service did not return an error. This could be an internal Windows
error or an internal service error.
If the problem persists, contact your system administrator.

I've tried moving the service over to running as my user account to see if
there was a permissions issue involved there, and it still gives me the same error. Is there any way to debug what is causing the service to fail to
start?

Thanks.
Ryan Gregg

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've written up a service in a C# using VS.NET to create the framework for me. However, I can't seem to get the service installed properly. When I run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for any
information about what could be causing this, but haven't come up with

much.

Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg



Nov 16 '05 #7

P: n/a
Alex,

Thanks for the response. Turns out there was a problem that my service was
missing it's .config file, and wasn't handleing the missing parameters in a
kind and gentle fashion. Fixing (read: adding) the error handling code
around reading from app.config as well as actually giving it a config file
solved my problems.

Thanks again.

Ryan Gregg

"Trebek" <al********@intheformofaquestion.com> wrote in message
news:c1*****************@fe37.usenetserver.com...
Ryan,

Is your service starting the application in an independent thread? As I'm
sure you know from the docs, a service has only 30 seconds to return from
the intial method call to be considered 'started'. Usually, you can just
start the service in an independent thread so it will return immediately.
If this is not the problem, post your service OnStart, Pause, etc... and I'm sure people will help you.

Alex

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:ek**************@TK2MSFTNGP12.phx.gbl...
Arg. Let me try that again. I can install the service sucessfully now that
I'm using the LocalSystem account instead of LocalService.

However, when I try to start the service now, I get this error:

---------------------------
Microsoft Management Console
---------------------------
Could not start the TACS Runtime Service service on Local Computer.
The service did not return an error. This could be an internal Windows
error or an internal service error.
If the problem persists, contact your system administrator.

I've tried moving the service over to running as my user account to see if
there was a permissions issue involved there, and it still gives me the

same
error. Is there any way to debug what is causing the service to fail to
start?

Thanks.
Ryan Gregg

"Ryan Gregg" <rg****@wheatlandsystems.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I've written up a service in a C# using VS.NET to create the framework

for me. However, I can't seem to get the service installed properly. When I
run the InstallUtil on the service exe, it errors out, reporting the
following shortly after trying to create the event log:

An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The account name is invalid or does not exist, or the password is invalid for the account name specified

It then rolls back the installation. I've tried looking online for

any information about what could be causing this, but haven't come up with

much.

Anyone out there have any ideas? Thanks a bunch.

Ryan Gregg



Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.