views:

103

answers:

4

This may already exist I hope.

I want to create a Windows service that schedules tasks (much like the Windows o e) but it would run C# assembles dynamically from a local folder (schedule rules via a XML file for that task) so I don't have to create a Windows service or console application every time I want some automation code but can build an assembly, upload it to a directory with a XML config for the timing and it will run/ be detected b a folder watcher.

Does this already exist or will I have to build it?

A: 

Sounds like a job for Windows PowerShell.

Do you have a simple code example?
Robert Harvey
+4  A: 

It's probably starting to look like I'm promoting this.... Try Quartz.Net

http://quartznet.sourceforge.net/

Austin Salonen
+1 Posted duplicate answer before I saw yours.
Nathan
@Nathan: Then maybe you should delete yours? ;p
Svish
+1  A: 

Take a look at Quartz.NET (http://quartznet.sourceforge.net/). It may serve your needs.

Nathan
A: 

I assume you want to automate the invocation of code in any arbitrary .NET assembly, even those for which you don't have the source code, rather than a plug-in approach with a well defined interface. If so you'll be building a generic service that can watch the config file, which itself must contain all of the details on which assemblies to load, which types to instantiate, which properties to set, which methods to call and their arguments, etc. You might perform all of this work via reflection, or Unity and/or XAML may be of help in constructing the objects.

Depending on how sophisticated you want to get, your config file will end up looking very much like C# code, so it may not be as worthwhile an exercise as you think.

Wayne