fkheng Posted May 20, 2003 Posted May 20, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant Posted May 20, 2003 Posted May 20, 2003 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. Quote
fkheng Posted May 20, 2003 Author Posted May 20, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant Posted May 20, 2003 Posted May 20, 2003 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? Quote
fkheng Posted May 20, 2003 Author Posted May 20, 2003 (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 May 22, 2003 by divil Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted May 20, 2003 Author Posted May 20, 2003 the attachment file... unzip it, the name of my code is MyService...myservice.zip Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Administrators PlausiblyDamp Posted May 20, 2003 Administrators Posted May 20, 2003 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?) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
fkheng Posted May 20, 2003 Author Posted May 20, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Guest mutant Posted May 20, 2003 Posted May 20, 2003 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. Quote
Administrators PlausiblyDamp Posted May 20, 2003 Administrators Posted May 20, 2003 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
fkheng Posted May 20, 2003 Author Posted May 20, 2003 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... Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted May 21, 2003 Author Posted May 21, 2003 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! Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
fkheng Posted May 22, 2003 Author Posted May 22, 2003 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? Quote Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.