Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I run some common code from both (a) scheduled via Windows Task & (b) manually from within WinForms app?
    primarykey
    data
    text
    <p>QUESTION - How can I run some common code from both (a) scheduled via Windows Task &amp; (b) manually from within WinForms app?</p> <p>BACKGROUND:</p> <ul> <li>This follows on from the <a href="https://stackoverflow.com/questions/2489999/how-can-i-schedule-tasks-in-a-winforms-app">How can I schedule tasks in a WinForms app?</a> thread</li> </ul> <p>REQUIREMENTS</p> <ul> <li>C# .NETv3.5 project using VS2008 </li> <li>There is an existing function which I want to run both (a) manually from within the WinForms application, and (b) scheduled via Windows Task. </li> </ul> <p>APPROACHES </p> <ul> <li>So what I'm trying to understand is what options are there to make this work eg</li> <li>Is it possible for a windows task to trigger a function to run within a running/existing WinForms application? (doesn't sound solid I guess)</li> <li>Split code out into two projects and duplicate for both console application that the task manager would run AND code that the winforms app would run</li> <li>Create a common library and re-use this for both the above-mentioned projects in the bullet above</li> <li>Create a service with an interface that both the task manager can access plus the winforms app can manage</li> </ul> <p>Actually each of these approaches sounds quite messy/complex - would be really nice to drop back to have the code only once within the one project in VS2008, the only reason I ask about this is I need to have a scheduling function and the suggestion has been to use <a href="http://taskscheduler.codeplex.com/" rel="nofollow noreferrer">http://taskscheduler.codeplex.com/</a> as the means to do this, which takes the scheduling out of my VS2008 project...</p> <p>thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload