.Net Windows Service Issue

T

tmagney

I have created a windows service in VB.Net called 'Import Agent'. In
the event log, when the service starts, the source is listed as
Service1. Everywhere else that matters, like the MMC, my project and
solution names, and the name of my service class all have the correct
name. I changed the startup object in my project's properties from
Service1 to ImportAgent. I even went through the registry and changed
every reference from Service1 to Import Agent that may have been
related to my service. I reinstalled the service several times and
rebooted my dev machine but no luck.

I am not directly writing to the Event Log, I believe the Winddows
Service Manager does it automatically. When my service does write to
the event log, I am able to set the source name programaticaly, so no
problems their. However I cannot for the life of me figure out how to
get windows to write the name of my service as the source, and not
Service1 on startup. Any ideas?

TIA

Tyson
 
T

tmagney

Ok, so I figured it out. I did another search for Service1 in my
service class and I found this line;

Me.ServiceName = "Service1"

So I changed it to "Import Agent", rebuilt the service and started it.
That did the trick. I thought I had already combed through my code for
any reference to Service1 but apparently I missed one. Anyway, sorry
about the false alarm. Hopefully this post will come in handy for
someone else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top