473,382 Members | 1,583 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,382 software developers and data experts.

Windows Service Question

I have a windows service project created with a timer that fires an event
over and over. I created an installer & the service appears to install
correctly. When I try to start the service I get a message that the service
started and stopped. Is there some setting I need to do to make the service
keep going until I tell it to stop?

Thanks,
Nathan
Nov 17 '05 #1
4 3271
When a service stops this usually means an exception is being thrown or some
other problem.

Look in the "Administrative Tools > Event Viewer"

In the application event log, you should find an entry with your service's
name.

-Brian
I have a windows service project created with a timer that fires an
event over and over. I created an installer & the service appears to
install correctly. When I try to start the service I get a message
that the service started and stopped. Is there some setting I need to
do to make the service keep going until I tell it to stop?

Thanks,
Nathan


Nov 17 '05 #2
Thanks, I was tring to run a trace to a file and file permissions were not
there. After removing this code and trying to reinstall the service I keep
getting a message that the specified service is marked for deletion. Does
this mean I need to reboot every time I retry my service?

Thanks,
Nathan

"Brian Corcoran" <fa**@email.com> wrote in message
news:28*********************@news.microsoft.com...
When a service stops this usually means an exception is being thrown or
some other problem.

Look in the "Administrative Tools > Event Viewer"

In the application event log, you should find an entry with your service's
name.

-Brian
I have a windows service project created with a timer that fires an
event over and over. I created an installer & the service appears to
install correctly. When I try to start the service I get a message
that the service started and stopped. Is there some setting I need to
do to make the service keep going until I tell it to stop?

Thanks,
Nathan


Nov 17 '05 #3
I've never had an error when uninstalling a service. The error is from InstallUtil.exe?

Can you post the error?

As a side note, when I write services, I put all the code I can in a DLL
project, and in the service project I just put the timer and event handling
to call the DLL. I also add a console app project, and I use the console
app to debug the DLL. This way you're not having to run the service to debug
the DLL if it has problems. Of course, this doesn't test everything, but
I find it very helpful.

--Brian

Thanks, I was tring to run a trace to a file and file permissions were
not there. After removing this code and trying to reinstall the
service I keep getting a message that the specified service is marked
for deletion. Does this mean I need to reboot every time I retry my
service?

Thanks,
Nathan
"Brian Corcoran" <fa**@email.com> wrote in message
news:28*********************@news.microsoft.com...
When a service stops this usually means an exception is being thrown
or some other problem.

Look in the "Administrative Tools > Event Viewer"

In the application event log, you should find an entry with your
service's name.

-Brian
I have a windows service project created with a timer that fires an
event over and over. I created an installer & the service appears
to install correctly. When I try to start the service I get a
message that the service started and stopped. Is there some setting
I need to do to make the service keep going until I tell it to stop?

Thanks,
Nathan


Nov 17 '05 #4
Brian,
I eventually got everything to work.

I had to manually delete the folder the project had installed to. I haven't
had a problem since.

I had previously used a windows form for a testing harness. Even the timers
were in the dlls. I had done some things that I wasn't allowed to do like I
had my database location saved in an xml file and was logging trace to a txt
file. I updated it to log the trace to sql and for the time being made the
connection string hardcoded.

I was able to get my service to work correctly. Thank you very much.

Nathan

"Brian Corcoran" <fa**@email.com> wrote in message
news:28*********************@news.microsoft.com...
I've never had an error when uninstalling a service. The error is from
InstallUtil.exe?

Can you post the error?

As a side note, when I write services, I put all the code I can in a DLL
project, and in the service project I just put the timer and event
handling to call the DLL. I also add a console app project, and I use the
console app to debug the DLL. This way you're not having to run the
service to debug the DLL if it has problems. Of course, this doesn't test
everything, but I find it very helpful.

--Brian

Thanks, I was tring to run a trace to a file and file permissions were
not there. After removing this code and trying to reinstall the
service I keep getting a message that the specified service is marked
for deletion. Does this mean I need to reboot every time I retry my
service?

Thanks,
Nathan
"Brian Corcoran" <fa**@email.com> wrote in message
news:28*********************@news.microsoft.com...
When a service stops this usually means an exception is being thrown
or some other problem.

Look in the "Administrative Tools > Event Viewer"

In the application event log, you should find an entry with your
service's name.

-Brian

I have a windows service project created with a timer that fires an
event over and over. I created an installer & the service appears
to install correctly. When I try to start the service I get a
message that the service started and stopped. Is there some setting
I need to do to make the service keep going until I tell it to stop?

Thanks,
Nathan


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Eric Chong | last post by:
I created a Windows Service in C# that requires to get passed command arguments like a Console App. I noticed that there is an option "Start parameters" text box in the property of a Windows...
4
by: Bill Sonia | last post by:
I'm written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that once my send mail code is...
5
by: Richard Steele | last post by:
I have created a WinForm application that needs to be run as a windows service (the PC is inaccesible by any user) i have successfully installed the application as a windows service. When i start...
17
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
2
by: shyam | last post by:
I have a C++ COM based windows service which have more than 30k lines of code and which is stablized over years. We need to take the advantage of the ..NET framework for this project, especially...
5
by: Tom | last post by:
Using multiple System.Timers.Timer objects in a Windows Service for performing multi-thread activities in a periodic fashion. Timers are AutoReset=false, to only have a single timer execution...
2
by: =?Utf-8?B?Sm9obiBG?= | last post by:
Hello All, I have a question about using an ActiveX control with a Windows Servce in C#. I believe it is not possible to properly setup an ActiveX control in a windows service as the particular...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.