tag:blogger.com,1999:blog-6391301786692278832.post3219089450126113715..comments2023-10-26T04:34:04.232-07:00Comments on C# & vb .Net Codes and components...: Create, Debug, Install Windows Service in Visual Studio .Net 2005/2008Unknownnoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-6391301786692278832.post-48728788208932753572010-10-17T19:46:44.918-07:002010-10-17T19:46:44.918-07:00Hi,
This is a really helpful example. One questio...Hi,<br /><br />This is a really helpful example. One question, what is the advantage of using a thread to start and stop the work?<br /><br />From what little I understand about this in the StartWork method one will either fire of a new thread, start a timer, start a listener or similar.<br /><br />And your code waits for the startup/shutdown thread to complete anyway... so is there any real need to put the startup and shutdown inside their own threads?<br /><br />Cheers,<br /><br />DaleAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-70329552726927247152010-06-02T11:41:51.512-07:002010-06-02T11:41:51.512-07:00PLEASE HLP.Two failed
1. 'MyServiceConsoleApp....PLEASE HLP.Two failed<br />1. 'MyServiceConsoleApp.MyServiceInstaller.Dispose(bool)': no suitable method found to override<br />2. Unable to build custom action named 'Primary output from MyServiceConsoleApp (Debug Any CPU)', InstallerClass property is only valid for assemblies.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-90301536143629584712010-04-20T09:09:55.050-07:002010-04-20T09:09:55.050-07:00Very helpful article. Thanks for sharing.Very helpful article. Thanks for sharing.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-50000195433999704442010-04-19T14:46:31.419-07:002010-04-19T14:46:31.419-07:00Life saver ThanksLife saver ThanksJay's Web Devhttps://www.blogger.com/profile/13776743675692799928noreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-33590063793534887312009-10-06T06:27:49.907-07:002009-10-06T06:27:49.907-07:00Hello,
I am using Visual Studio 2008 on Vista 64bi...Hello,<br />I am using Visual Studio 2008 on Vista 64bit. I have followed your steps exactly. I am getting the following errors:<br /><br />1. 'MyServiceConsoleApp.MyServiceInstaller.Dispose(bool)': no suitable method found to override<br />2. Unable to build custom action named 'Primary output from MyServiceConsoleApp (Debug Any CPU)', InstallerClass property is only valid for assemblies.<br /><br />Could you please let me know what to do to fix this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-55629226053560164782009-10-02T14:55:34.382-07:002009-10-02T14:55:34.382-07:00Hello,
I followed your steps and everything is wor...Hello,<br />I followed your steps and everything is working. The problem is that I do not know how to debug. Please send me the detailed steps on this.<br />Thank you.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-4172319827221947042009-08-26T03:54:37.233-07:002009-08-26T03:54:37.233-07:00Hi, I tested this to my web application with a sep...Hi, I tested this to my web application with a seperate projects inside the solution so when I worked inside console mode it gives me the results successfuly which I retrive the results from DB and extract it into log file all of this works successfully inside console mode but inside the window services there is no results with the text file is your example just support printing #Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-74873608581482207602009-05-19T15:27:57.300-07:002009-05-19T15:27:57.300-07:00Do you mean VB.Net or VB6? If you are looking for ...Do you mean VB.Net or VB6? If you are looking for a VB.Net version, you can simply copy the code and convert it 100% reliably at <A HREF="http://www.carlosag.net/Tools/CodeTranslator/" REL="nofollow">http://www.carlosag.net/Tools/CodeTranslator/</A>. If you are looking for a VB6 version of the same code, let me know. I can write it and send it across.Yours truly ...https://www.blogger.com/profile/12793648174481184625noreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-90249970491522470122009-05-19T09:24:00.000-07:002009-05-19T09:24:00.000-07:00Do you have this in a vb version?Do you have this in a vb version?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6391301786692278832.post-79034630845366897052009-05-16T06:05:00.000-07:002009-05-16T06:05:00.000-07:00If you want to auto-start the service as soon as i...If you want to auto-start the service as soon as it is installed, you can override the OnAfterInstall or subscribe to the ServiceInstaller's Committed event. In the eventhandler, you may create an instance of ServiceController class and call the Start method passing your serviceName as an argument. So for the code given above, just paste the following code at the end of MyServiceInstaller class.<br /> // *********************************************************************<br /> /// <summary><br /> /// Raises the System.Configuration.Install.Installer.AfterInstall event.<br /> /// </summary><br /> /// <param name="savedState">An <br /> /// <see cref="System.Collections.IDictionary "/> that contains the <br /> /// state of the computer after all the installers contained in the <br /> /// System.Configuration.Install.Installer.Installers property have <br /> /// completed their installations.</param><br /> protected override void OnAfterInstall(IDictionary savedState)<br /> {<br /> base.OnAfterInstall(savedState);<br /> ServiceController controller = new ServiceController(ServiceName);<br /> controller.Start();<br /><br /> }Yours truly ...https://www.blogger.com/profile/12793648174481184625noreply@blogger.com