C# .NET - Interacting with Windows Service

Asked By 12348765 Shvartsman
20-Nov-09 08:32 AM
I have a C# Windows Service that performs certant actions on periodic bases. The System.Timers.Timer on the separete thread is used perform the actions. Some times those actiones need to be performed on demand. I need a way for console app to instract Windows Service to perform those actions. Thank you in advance

Those actions should be in separate assemblies  Those actions should be in separate assemblies

20-Nov-09 08:48 AM
that can be included with your console application.  You should not have to tie into a windows service at all.

All you need is a Messaging Queue to cater to your on-demand and scheduled service actions.  All you need is a Messaging Queue to cater to your on-demand and scheduled service actions.

22-Nov-09 04:54 AM
Peter calls it "Self-Updating Windows Service Infrastructure with Command Pattern Message Queue Invoker Service". and here is the article supporting this whole stuff.

And http://msdn.microsoft.com/en-us/library/ms973816.aspx is a complete step-by-step article at MSDN. This article outlines a Windows service solution designed to process several message queues, using C#. 



Create New Account
help
Time (US & Canada). [11 / 17 / 2011 19:10:25.0731] [0] Operating System version: Microsoft Windows NT 6.1.7601 Service Pack 1. [11 / 17 / 2011 19:10:25.0731] [0] Setup version: 14.1.339 0731] [0] Logged on user: MR238 \ ddennis. [11 / 17 / 2011 19:10:26.0246] [0] Command Line Parameter Name = 'mode', Value = 'Install'. [11 / 17 / 2011 19:10:26.0246] [0] Command Line Parameter Name = 'sourcedir', Value = 'D: \ '. [11 / 17 / 2011 19:10:26.0246] [0] Command Line Parameter Name = 'fromsetup', Value = ''. [11 / 17 / 2011 19:10:26.0246] [0] ExSetupUI was started with the following command: '-mode:install -sourcedir:D:" / FromSetup'. [11 / 17 / 2011 19:10:26.0495] [0] Setup is encountered an exception when trying to access the setup state file: Could not find file 'C: \ ExchangeSetupLogs \ exchangeInstallState.xml'. [11 / 17 / 2011 19:11:40.0020] [0] Setup is determining what bin \ EnterpriseServiceEndpointsConfig.xml". [11 / 17 / 2011 19:14:14.0386] [1] Writing informational script to 'C: \ ExchangeSetupLogs \ Start-PreConfiguration-20111117-13141306991562273802.ps1' [11 / 17 / 2011 19:14:14.0386] [1] Executing
Time (US & Canada). [11 / 17 / 2011 19:10:25.0731] [0] Operating System version: Microsoft Windows NT 6.1.7601 Service Pack 1. [11 / 17 / 2011 19:10:25.0731] [0] Setup version: 14.1.339 0731] [0] Logged on user: MR238 \ ddennis. [11 / 17 / 2011 19:10:26.0246] [0] Command Line Parameter Name = 'mode', Value = 'Install'. [11 / 17 / 2011 19:10:26.0246] [0] Command Line Parameter Name = 'sourcedir', Value = 'D: \ '. [11 / 17 / 2011 19:10:26.0246] [0] Command Line Parameter Name = 'fromsetup', Value = ''. [11 / 17 / 2011 19:10:26.0246] [0] ExSetupUI was started with the following command: '-mode:install -sourcedir:D:" / FromSetup'. [11 / 17 / 2011 19:10:26.0495] [0] Setup is encountered an exception when trying to access the setup state file: Could not find file 'C: \ ExchangeSetupLogs \ exchangeInstallState.xml'. [11 / 17 / 2011 19:11:40.0020] [0] Setup is determining what bin \ EnterpriseServiceEndpointsConfig.xml". [11 / 17 / 2011 19:14:14.0386] [1] Writing informational script to 'C: \ ExchangeSetupLogs \ Start-PreConfiguration-20111117-13141306991562273802.ps1' [11 / 17 / 2011 19:14:14.0386] [1] Executing
Text = = "All" && CheckBoxList1.SelectedIndex = = -1) { cmd = new SqlCommand ( "select a.img, a.prop_name, b.state_name, c.city_name, d.price, d.prop_price_type, d.builtup_area, d.carpet_area, d.bedrooms, d.prop_desc, e.ownership_name from tbl_image_entry a, tbl_state_new b, tbl_city_new c, tbl_new_sale_property d, tbl_ownership_master e where a.user_id = d.user_id and b.state_id = d.state and c.city_id = d.city and a.prop_name = d.prop_name and e.ownership_id = d.prop_ownership and prop_type CheckBoxList1.Items[2].Selected = = false ) { cmd = new SqlCommand ( "select a.img, a.prop_name, b.state_name, c.city_name, d.price, d.prop_price_type, d.builtup_area, d.carpet_area, d.bedrooms, d.prop_desc, e.ownership_name from tbl_image_entry a, tbl_state_new b, tbl_city_new c, tbl_new_sale_property d, tbl_ownership_master e where a.user_id = d.user_id and b.state_id = d.state and c.city_id = d.city and a.prop_name = d.prop_name and e.ownership_id = d.prop_ownership and prop_ownership CheckBoxList1.Items[2].Selected = = false ) { cmd = new SqlCommand ( "select a.img, a.prop_name, b.state_name, c.city_name, d.price, d.prop_price_type, d.builtup_area, d.carpet_area, d.bedrooms, d.prop_desc, e.ownership_name from tbl_image_entry a, tbl_state_new b, tbl_city_new c, tbl_new_sale_property d, tbl_ownership_master e where a.user_id = d.user_id and b.state_id = d.state and
Hello all, i like to setup a fast clonable test / development installation of MOSS2007 under Windows 2008 SP1 (not R2) (32bit). As starting point I have choosen the Blog post from local domain ist named SPTEST.INT. After the creation of the web applications, the shared service provider and finally the colaboration site as described in the howto, i like to login allowed to login, althoug SPTEST \ spadmin has full access rights to all webapplications. The red message saying, that the SP installation has not been not finished, is not present anymore. I know where I did a mistake, but currently I am reading the logfiles placed under "c: \ program files \ common files \ microsoft shared \ web server extensions \ 12 \ logs". I don't find to sspadmin-site is attached. best regards Joerg Timestamp Process TID Area Category EventID Level Message Correlation 03 / 04 / 2010 13:53:00.56 OWSTIMER.EXE (0x0980) 0x0988 ULS Logging Unified Logging Service 8wsv High ULS Init Completed (OWSTIMER.EXE, ONETNA~1.DLL) 03 / 04 / 2010 13:53 04.93 OWSTIMER.EXE (0x0980) 0x0988 ULS Logging Unified Logging Service 8wsv High ULS Init Completed (OWSTIMER.EXE, onetnative.dll) 03 / 04 / 2010 13:53:04.95 OWSTIMER.EXE (0x0980) 0x0988 Windows SharePoint Services Topology 0 Medium Diagnostics settings: 32768 03 / 04 / 2010 13:53:05.38