Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello All,

Framework using:2010 Ultimate
.net framework:3.5
Operating system : 2008 enterprise R2

Task done: I have created a web application(.aspx); containing coding related to consumption of web services, creation of word document reports (DOCX:using openxml library)and some dotnetcharting libraries.

Research/Outcome:This application has to be called automatically every month end say : 30 of every month. now :
1) I am not sure whether I did right to create it in webapplication format?Please suggest if something better?
2) Most important, can this be done in Windows dll sort of thing( just read in help ) where it can be called be windows schedulers?
3) can we call this in webapplication format as well if yes then please assist?

As I had experience in PHP we create a webpage there and then it will be called by Cron jobs on linux and will automatically executed?

End goal:application would be called automatically at every 30 of month and then stop after doing all work.

Thanks in advance.

-Mahendra Varandani
Posted
Updated 10-Dec-12 3:06am
v2

1 solution

Hi
I think you could have created the solution comprising of two projects i.e.,
1. dot net library project to have the DOCX conversion code + charting code
2. Consume the library using a stand alone console application (if it is not be accessed from outside)
3. Configure the schedule jobs to run the console application at given schedules.

Regards
Pawan
 
Share this answer
 
Comments
masdhasdh 11-Dec-12 10:01am    
Thanks pawan...

But I can say it is a kind of web application where admin panel is also there.. Obvious it would only accessible on a single PC ( Server) not accessible via other machine or network.

so is there any possibility that we can make a project run in a cron job as www.localhost.com/default.aspx only?

thanks again
Rai Pawan 12-Dec-12 0:08am    
Okay, so in case the functionality apart from being executed once every month is to be manually executed from a request from the admin panel (windows form/web form), then I think the structured approach would be to expose the functionality as web services which you have already done, now you may consume those services in your windows application i.e., the admin panel and simultaneously in the console application which will be referenced by the windows scheduler. Why I am recommending these two is because from the schedule there will be implications to run the windows forms application directly since there might be certain GUI interface that will require certain manual input and there might be other constraints too. here is a forum post on msdn about it wherein the developer had problem doing so http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/6361b9fa-b956-4dce-a856-9888cb767a14#f91befd7-6f67-41ed-a82c-07e10d6ce718

Regards
Pawan
masdhasdh 12-Dec-12 3:40am    
thanks pawan

So let me elaborate it little bit more..
there is admin.aspx and default.aspx

admin.aspx== will have GUI which contains various setting parameter which will be done manually (nothing at cron side)

default.aspx==contain the code which has be executed every month end (NO GUI,NO MANNUAL interruption required to execute) every function and code is written on page load as soon as page will be hit the code will execute and perform the required action..

So can't we do the same cron tab as in PHP? just marking the absolute path in cron and it will execute it..???

Thanks again..
Rai Pawan 12-Dec-12 4:02am    
for directly executing a page from command like you can check this link http://mohammednv.wordpress.com/2008/01/08/how-to-create-scheduled-tasks-for-aspx-files/ however I'd again emphasis that you should use console application instead of default.aspx page that is to be executed in a schedule.
masdhasdh 12-Dec-12 5:58am    
Thanks pawan for your concern..

So is there any major change I have to do while making it console application ??

or just to copy paste my whole code in the new console application only?

May I call web services as well in console applications?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900