Security Issue with C# Windows Service and EventLog

  • Thread starter Thread starter Carlo Razzeto
  • Start date Start date
C

Carlo Razzeto

I am trying to write a Windows Service that will periodically look through a
database for old user accounts. My problem is I wanted it to connect to my
computers EventLog to log errors. The code compiles just fine, however when
I try to actually install this Windows Service using InstallUtil, just after
it reports "creating event source for NotifyExpiredResume in Application"
(or something to that effect) it pops up with a strange dialog box with
requests me to enter a user name, then enter a password, then confirm the
password... I have tried using several accounts on my system, including ones
with Administrator and the installation fails every time. I have also tried
commenting the eventlog lines of code out of my project and it still asks
for a password. This is a very strange problem because it is trying to
create a source for NotifyExpriedResumes in the Application log when my code
tells it to Register as "JobSite" in the "JobSite" log, all of which is
already created, and then because it still tries to register this source
even though I commented out the lines... Anyone have any experience with
this type of issue?

Carlo
 
Carlo,

It sounds like it's just asking you to supply user credentials under which
the service
will run (has nothing to do with the event log). This happens if in the
Service Installer
you specify:

Me.InstallerClassName.Account = ServiceProcess.ServiceAccount.User

but supply no username/password. In this case, the username you supply must
be
fully qualified, ie:

domain\username

and shortcuts like:

.\username

for a local machine account do not work. You need to supply the actual
machinename:

machinename\username

Of course, the problem you are experiencing could be entirely unrelated, but
give it a
go...

--pat
 
Thanks for the information, it was invaluble! Now I can really start getting
to work!

Carlo
 
Back
Top