http://www.infini-tec.de/InfiniTec - Henning Krauses Blog - Developing Windows Services with .NET2009-06-23T18:05:37+00:00Don't adjust your mind - it's reality that is malfunctioning Henning KrauseBlogEngine.Net Syndication Generatorhttp://www.infini-tec.de/opml.axdHenning KrauseDon't adjust your mind - it's reality that is malfunctioning en-USInfiniTec - Henning Krauses Blog 0.0000000.000000http://www.infini-tec.de/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_aacdf32d-5a37-4680-a532-8df39fbb0d53<a class="comment_auth" href="http://www.merlinia.com/" alt="http://www.merlinia.com/" title="http://www.merlinia.com/">Rennie Petersen</a> on <a href="/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_aacdf32d-5a37-4680-a532-8df39fbb0d53" alt="/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_aacdf32d-5a37-4680-a532-8df39fbb0d53">Developing Windows Services with .NET</a>2009-06-23T18:05:37+00:00Rennie PetersenI&amp;amp;amp;amp;amp;amp;amp;#39;ve used a similar method for several years, always testing my Windows Service programs as console apps. It is a real life-saver.
But the method I&amp;amp;amp;amp;amp;amp;amp;#39;ve used to determine when starting as a Service or not is to test the System.Environment.UserInteractive property. This is true for a console app and false for a Windows Service. (Unless you turn on the &amp;amp;amp;amp;amp;amp;amp;amp;quot;Allow service to interact with desktop&amp;amp;amp;amp;amp;amp;amp;amp;quot; check box for the Service, but that&amp;amp;amp;amp;amp;amp;amp;#39;s only available for LocalSystem, and you shouldn&amp;amp;amp;amp;amp;amp;amp;#39;t be using LocalSystem anyway.)
2009-06-23T18:05:37+00:00Rennie Petersenhttp://www.infini-tec.de/pingback.axdhttp://www.infini-tec.de/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_aacdf32d-5a37-4680-a532-8df39fbb0d53http://www.infini-tec.de/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_aacdf32d-5a37-4680-a532-8df39fbb0d53#commenthttp://www.infini-tec.de/syndication.axd?post=aacdf32d-5a37-4680-a532-8df39fbb0d53http://www.infini-tec.de/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_35ae41d2-1c70-437a-9033-2f1718a7e551<a class="comment_auth" href="http://www.alvinashcraft.com/2009/06/23/dew-drop-june-23-2009/" alt="http://www.alvinashcraft.com/2009/06/23/dew-drop-june-23-2009/" title="http://www.alvinashcraft.com/2009/06/23/dew-drop-june-23-2009/">alvinashcraft.com</a> on <a href="/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_35ae41d2-1c70-437a-9033-2f1718a7e551" alt="/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_35ae41d2-1c70-437a-9033-2f1718a7e551">Developing Windows Services with .NET</a>2009-06-23T18:34:16+00:00alvinashcraft.comPingback from alvinashcraft.com
Dew Drop &amp;amp;amp;amp;amp;amp;amp;amp;#8211; June 23, 2009 | Alvin Ashcraft&amp;amp;amp;amp;amp;amp;amp;#39;s Morning Dew2009-06-23T18:34:16+00:00alvinashcraft.comhttp://www.infini-tec.de/pingback.axdhttp://www.infini-tec.de/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_35ae41d2-1c70-437a-9033-2f1718a7e551http://www.infini-tec.de/post/2009/06/13/Developing-Windows-Services-with-NET.aspx#id_35ae41d2-1c70-437a-9033-2f1718a7e551#commenthttp://www.infini-tec.de/syndication.axd?post=35ae41d2-1c70-437a-9033-2f1718a7e551