Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When coding a Windows Service, firstly, do i need to use a timer? Can i work without a timer?

 

Also, how do I create a Windows Service, and then make use of a User Interface, so that when the service is started, at least I can use the interface to control certain things?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant
Posted

You dont need a timer.

 

Windows Services are GUIless :), you need to make another application that will modify lets say registry settings or setting files that service uses.

Posted

i see, ok.....

 

er......i have a problem, after installing the Service i created thru the VB.NET command prompt, i get an error stating FileNotFound, and that a File or assembly name or a dependancy file could not be found...

 

i did everything accordingly, i do not know why this error has occured...any idea?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant
Posted

Did you add any files like DLL or something that your service reads to the same folder as your service?

What file is it looking for?

Posted (edited)

nope...i did not add any files of that sort to my folder...

 

it is lookiung for some file called My, the thi ng is i can't find, in my code, any syntax or line of code which specifies this filename...

 

the core of my code is basicallyt this :

 

Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
       Dim MyLog As New EventLog() ' create a new event log
       ' Check if the the Event Log Exists
       If Not MyLog.SourceExists("MyService") Then
           MyLog.CreateEventSource("MyService", "Myservice Log") ' Create Log
       End If
       MyLog.Source = "MyService"
       ' Write to the Log
       MyLog.WriteEntry("MyService Log", "This is log on " & _
       CStr(TimeOfDay), EventLogEntryType.Information)
   End Sub

 

This is just a tutorial i followed...just to test out a Windows Service, and how to create one...

 

the error msg is Exception occured while initiliazing the installation. System.IO.FileNotFoundException : File or Assembly name My, or one of its dependencies, was not found..

 

I think I'll attach the zip file of all the related files to my project...here for your reference...

Edited by divil
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
  • Administrators
Posted

Just unzipped your source, built the project and installed using

InstallUtil myservice.exe and everything seemed to work.

Checked under the services and Myservice was in the list, tried to start it and it started fine. So not sure what your problem was...

 

What did you do just prior to getting the Exception (install the service? run the service?)

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

was it wrong of me to run the service?

 

i am really unsure, but can u pls tell me wat i should not do...

 

also, there are 2 build options i realised,

 

one is Build the service

 

the other is Build the solution

 

wat is the difference?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant
Posted

There is no real difference, solution will build all projects that you have in soultion. If you choose to build a single project only it will be built.

That service works fine for me also.

  • Administrators
Posted

It looks as though you are refering to the service as

My Service

somewhere rather than

MyService

(notice the space between the two words).

 

If you could give a step by step guide of what you did to get that error I could see if you did something different to me.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
er.....okok, i'll try once i get home later tonite, i'm actually at work now, will get back to both of you later...thanx a lot, u guys have really been a lot of help to me...
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted
ok, while in the Service1.vb frame, i build solution, build myservice, and then ran the InstallUtil <path> command from the VS.NET command prompt, then i get the same error again! wat cou ld be wrong man!
Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted

you guys really did not encounter any problem?

 

can u pls give me the proper sequence to do th ings so that i could try?

 

when do i install the service? after compiling or wat?

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...