Which solution is better for schedules task? Console application or windows service?

I have a "MULTI-LEVEL" XML file that I will be getting on daily basis and I want to accomplish following tasks:
1) I have to read and parse the "MULTI-LEVEL" XML data
2) Then I have to set or create some kind of .net service (c#) that read the xml and parse the data once a day (daily)?
3) Now I have SOAP service from other software where I want to feed this XML data to. The schedules service will compare the XML data with software data and update (or add) based on the comparision.
For this task, I come to conclusion that there are 2 best ways to do this:
1) Create a console application and use windows task scheduler to run it everyday
2) Create a windows service that runs in the background
Which is a better way (or reliable)  solution to do this task? Please advise

There are several things to keep in mind when writing an app that is designed to run without a user logged in. One of the most common mistakes is requiring some sort of user input.  Since the task will run without user intervention you don't want
any sort of calls to Console.ReadLine, MessageBox.Show, etc.  They will cause the task to freeze and eventually need to be terminated.  You also don't want to rely on any sort of desktop apps running since a user may or may not be logged on at the
time.
Also be aware that a task can be scheduled to run under any user context.  As such you either need to ensure it runs under an account with sufficient privileges or that your app needs no special privileges.  You mentioned you tried to run it from
bin\debug but you most likely have your project under your Documents directory.  Only you would have permissions to that folder and therefore will run into issues if the task is run under a different context.  You also mentioned you put it in the
C:\ but users don't have write privileges to that folder and therefore if you tried to write a file out it would fail. If you need to read/write files then you should pick a common location that all users have access to or at least the one that will run the
scheduled task. Be aware that, by default, Task Scheduler will not run a task elevated. You need to check the option to run elevated when you configure the user to run the task under.
One of the key things to ensure you do with a task is verify it is working properly as a normal app.  You should also ensure that you have good logging so that if it does fail you can trace down the failure more easily.  One common thing that people
tend to do in console apps is put a try-catch around the main function and display a message if an unhandled exception occurs. This is going to cause problems in a task.  Simply log the exception and rethrow it so Task Scheduler will flag the run as a
failure.
If you still cannot figure out why your task is failing then please add some logging and then tell us what code is being run at the time and what the failure is.

Similar Messages

  • I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    I am going to buy a macbook pro for grade 12, and I need to know wheather I should get a macbook pro or a macbook pro retina. If someone could tell me (in a very simple way) which one is,better for me and why, I would be ever so apprreciative.

    Why do you need a expensive MacBook Pro?
    Your attending high school and unless everyone else is rich also your likely going to be a target by the more poorer students for theft or damage to the machine.
    You could keep it home, but if you need it for class then your exposed again.
    Also at that age your not very careful yet, a MacBook Pro is a expensive and easily damaged machine.
    Unless your made of money and so are others at your school, I would recommned a low profile, just does the job cheap Windows PC.
    If it dies, gets lost, stolen or damaged because of your inexperince handling senstivie electronics then it's no big deal.
    You can buy a Mac later on when your sure you have a need for it, currently there isn't much advantage of owning a Mac compared to a PC, they do just about the same things now, one just looks prettier than the other.
    Since 95% of the world uses Windows PC's your going to have to install Windows on the Mac in order to keep your skills up there or be unemployed, so it's a extra headache and expense.
    good luck

  • Which IDE is better for HTML/AJAX development in AIR?

    Hi everyone,
    Which IDE is better for HTML/AJAX development in AIR?
    Dreamweaver or Aptana????
    Thanks for all your help
    IrishAIRMax

    Anyone have an opinion on this?

  • Which tool is better for ETL?

    I want to transfer data from RLDB to Essbase, there are many method and tools, I don't know which tool is better for my case. Now, what I am doing now is:
    1. Create views in Oracle
    2. Export view to falt file
    3. Import flat file to Essbase using rule file and MaxL import script.
    4.The data size: flat file rows 3-4 million, time used: 13 hours
    I want to use more powerful ETL tools, such as: Informatica PowerCenter, OBIEE, FDM, EIS, ..., I have basic knowledge for the above tools, but don't know which tool is better for my case? Please advise?

    First to streamline your existing process, you could get rid of step 2 and add a odbc connection to the server and Sql statement to the load rule to pull directly from your Oracle database. Of course with the number of rows you have, if you use the same extract multiple times, I would create a table to load into from the view and pull from that table.
    As for using an etl (Elt) tool, Informatica is pretty powerful and there is a version of it (although not supported in the future called DIM). I might go the ELT route with ODI(Oracle Data Integrator). In the future I might use OBIEE, but I don't think it fully ready for Essbase until the next version and I don't think it will rank on the same level as a full ETL tool for conversions.
    Edited by: GlennS_2 on Jan 2, 2010 9:58 AM
    As for EIS, I would not use it, but might use Essbase Studio. (It can use OBIEE as a source) again this is not an etl tool, it would just take youe existing views and load them.

  • Which board is better for P4 3.0E Prescott

    Hello Guys! just wanted to ask which board is better for P4 3.0E Prescott
     MSI 865PENEO2-PFISR
    or
     MSI 865PE NEO2-PFS
    Thanks in advance......

    Basically the same MoBo ( only the Firewire/SATA raid is differant )
    http://www.msi.com.tw/program/products/mainboard/mbd/pro_mbd_detail.php?UID=528
    You´ll be fine with either of them.
    Most people think bios 3.8 or 3.A is best for prescott cpu´s ( lower reported cpu temp)

  • Which program is better for reducing noise in photos and increasing sharpness?

    Which program is better for reducing noise in photos and increasing sharpness?

    And based on what criteria as in "Which program of [insert names here]?" and "What files?" ? Sorry, your post simply is not much use.
    Mylenium

  • Which material is better for Green Screen?

    Which material is better for Green Screen? Polyester or Muslin??

    woof
    check this out...is same as my link above type material.. is not shiny..is matte...spongy...stretchy...nice. If you have worked an 18 hour day on job and don't wanna do the 10 hour turnaround for next call time...you can even "sleep on it ".
    http://www.fxguide.com/featured/pan-am-retro-green-screen-world/
    go grips ! ( or was that go vikings ? ! )
    ps.. the 'comments' on that web site for pan am are from non pro's... silly ...
    they are not comments that have a clue whats up in pro work...sorry..but is fact.
    the DIT station ( live during shots ) could mix the background and live shots live...so you 'see' on monitor what you get at end of edit and keying.
    trust me, this is very advanced.
    dont worry about the small stuff.. just test and shoot and test and shoot and get what you need.. live ..no post work is good work.
    dont know how else to say this.. guess you had to be there.
    try to imagine live and keyed at same time...melt the pictures in link you see in your head...original with screen, end result with key...is fun

  • Which app is better for learning spanish:byki or mindsnacks?

    Which app is better for learning spanish:byki or mindsnacks?

    YOu should read the reviews/ratings for each app and see how other users like it.

  • How do we create user defined Task in OM & Which report we run for the Task

    Hi
    How do we create user defined Task in OM & Which report we run for the Task.
    Regards
    Rajesh

    You can create tasks using PFCT or path: Human resources> Organizational management> Expert mode> Task catalog in Easy access.
    Check this link may be useful for you: http://help.sap.com/saphelp_40b/helpdata/pt/fb/135d89457311d189440000e829fbbd/content.htm

  • HP Pavilion DV7 Battery, 4400mAh, 6600mAh ,8800mAh, which capacity is better for my hp laptop?

    HP Pavilion DV7 Battery, 4400mAh, 6600mAh ,8800mAh, which capacity is better for my hp laptop?
    Home
    >>
    HP/Compaq
    >>
    HP Pavilion DV7 Battery
    HP Pavilion DV7 Battery
    30 day money back ! 1 year warranty !
    Product Name :HP Pavilion DV7 Battery
    The replacement HP Pavilion DV7 battery is specially designed for the original 6-12 Cell HP Pavilion DV7 battery.These high quality replacement batteries are engineered to meet or exceed original specifications assuring better performance and longer life. The quality of this HP/Compaq laptop battery is in high grade quality and certified by CE and RoHS. You can reassure of purchasing it!
    Capacity :8800mAh
    Voltage :10.8V
    Cell Type :Li-ion
    Color :Black
    Weight :531g
    Dimensions :205*53*38mm
    Price :£ 54.57
    Shopping Cart :
    HP Pavilion DV7 Battery
    30 day money back ! 1 year warranty !
    Product Name :HP Pavilion DV7 Battery
    The replacement HP Pavilion DV7 battery is specially designed for the original 6-12 Cell HP Pavilion DV7 battery.These high quality replacement batteries are engineered to meet or exceed original specifications assuring better performance and longer life. The quality of this HP/Compaq laptop battery is in high grade quality and certified by CE and RoHS. You can reassure of purchasing it!
    Capacity :6600mAh
    Voltage :10.8V
    Cell Type :Li-ion
    Color :Black
    Weight :450g
    Dimensions :205*53*38mm
    Price :£ 48.57
    Shopping Cart :
    HP Pavilion DV7 Battery
    30 day money back ! 1 year warranty !
    Product Name :HP Pavilion DV7 Battery
    The replacement HP Pavilion DV7 battery is specially designed for the original 6-12 Cell HP Pavilion DV7 battery.These high quality replacement batteries are engineered to meet or exceed original specifications assuring better performance and longer life. The quality of this HP/Compaq laptop battery is in high grade quality and certified by CE and RoHS. You can reassure of purchasing it!
    Capacity :4400mAh
    Voltage :10.8V
    Cell Type :Li-ion
    Color :Black
    Weight :361g
    Dimensions :205*53*38mm
    Price :£ 34.57

    I'm pretty sure battery capacity doesn't related with power performance of your system.. (in a notebook)
    well perhaps this is just another way of people to advertise their website.
    anyway. go for the biggest capacity, make sure it's genuine, and you can unplug ur battery if you dont  have one

  • Hi. I am preparing for CA Bar Exam. I am considering buying MacBook Pro for exam writing. One is 13 inch 1499 dollar 2.5 GHz 8GB, the other is 15 inch MacBook Pro 2.7 GHz 2799 dollar 16 GB. Both are retina. Which one is better for me?

    Hi. I am preparing for CA Bar Exam. I am considering buying MacBook Pro for exam writing. One is 13 inch 1499 dollar 2.5 GHz 8GB, the other is 15 inch MacBook Pro 2.7 GHz 2799 dollar 16 GB. Both are retina. Which one is better for me?
    I will use Barclays Card for 18 month free interest.
    I wil ask Apple clerk to avoid LG monitor.
    I will buy those in Apple store.
    Which one will you recommend?

    Tha's something you need to decide for yourself.
    Do you think you need 16GB of memory or 8 will be enough?
    Do you need to carry your macbook around with you more often? if so just get the 13" it's easier to carry.
    Or maybe you enjoy watching media on a bigger screen?
    As for word processing it shouldn't be a problem on both notebooks.
    Also can you afford buying the 15"?
    And what about the hard drive capacity?
    So my advice is to consider these aspects, make a list of pros and cons and see what you come up with

  • Time capsule 2nd gen X airport express 5th gen - which one is better for primary base

    time capsule 2nd gen X airport express 5th gen - which one is better for primary base

    time capsule 2nd gen X airport extreme
    5th gen - which one is better for primary base

  • IOS4.1,4.33,5.01,5.1,which one is better for 3GS?

    IOS4.1,4.33,5.01,5.1,which one is better for 3GS?

    The 4.1 version for 3 gs is the best one .
    as far  as 5.1 its considerably slows the 3gs and 4.3.3 has known issues like  wifi signal dropping and battery drain. so you must stay on  ios 4.1 for your 3gs.

  • Services in SAP management console and related window services and process

    hai
    can u please any one of you can send me the services in SAP management console and related window services(in adminstrator/services) and process in task manager.
    thanks in advance.
    Naga Laxmi

    Hi Naga,
    Please refer to this article for the processes relevant to the Java Instance:
    http://help.sap.com/saphelp_nw04/helpdata/en/62/1bf03eae11e16be10000000a114084/frameset.htm
    Except the processes of the Java instance you can find several processes of the IGS server and the ABAP disp+work processes.
    You can easily find the relevant services by their SAP prefix.
    Hope this helps.
    Best Regards
    Vyara

  • C# Console Application with Cloud Services

    Hi All,
    can anyone tell how we can host our console application on windows Azure Cloud Service OR is it possible to host Console application on Azure Cloud Service.
    Thanks in Advance.
    Pravin Dhulap

    Hi,
    A cloud service consists of one or more web roles and/or worker roles, As far as I know, we can't host console application to azure cloud service directory, however, we can convert the console application to worker role, see the detailed steps here:
    http://blogs.lessthandot.com/index.php/desktopdev/mstech/converting-a-net-console-project/ , after these steps, a Console project promoted to Azure Worker Role.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • SSO for portal desktop for my applications

    Hi, how to impliment sso for applications that i developed. i created tabs and added the channels to container. now i wants to that maintain the session . i.e, once a user enters into portal desktop.and he clicks the tab and enters user name and pass

  • Home Sharing - ever going to be fixed?

    I seem to be having progressively more trouble with Home Sharing; for something that should work so simply, it fails much too regularly. My iTunes library is hosted from an always on machine wired directly into the main network router (Draytek Vigor

  • Computer with main library crashed. How do I transfer all files from ipod onto new computer without them being erased on ipod?

    The hard disk on my laptop which contained my main i-tunes library crashed. I want to make sure I have a backup of my music and apps on a different computer. How can I transfer the music and such from my ipod touch to the new computer without erasing

  • Time Machine to Apple Network Share

    I've got a Mac Mini and an iMac on a gigabit network. The Mac Mini has a USB 3.0 HDD attached to it which is the Time Machine backup for the Mac Mini. I've shared it via File Sharing and have access to that HDD on my iMac. I've also set it up as the

  • Listener suddenly looses connection to database reporting ORA-12518

    Hi all, This has been causing me endless problems for two days now and I desperately need to leave our database running before the weekend. I cloned our database and moved it to a new server following the instructions in this guide, after a quite a f