views:

31

answers:

1

i have an asp.net mvc site and i have a controller action that emails out reports to people. I want to have this run on a daily basis so i am trying to use the scheduler on windows.

As all i have is a URL, what is the best way of "executing" this url on a daily basis through windows schedular

+3  A: 

Don't schedule the controller.

Refactor your controller logic into a shared library, and call that library from the controller.

Then make a new executable (console app will suffice) that also uses the same shared logic.

Both the console app and the controller will do the same thing, through the re-use of the common code, and you can schedule your executable far more easily then you could schedule the loading of a page.

Michael Shimmins