So I created an Azure Web Job that performs a certain task every 15 mins. It runs a C# console application. The problem is that on my last upload of my program I left my
Console.ReadLine(); argument in, causing the program to never finish (used for local debugging of course) and the web job to fail and never run again. This can obviously be fixed real quick if I had the source code, but the source code is at my office, which I forgot to upload to my cloud storage. I won't have access to it till a bit later on this week.
So I'm looking for a quick fix. I can download the .exe program that was last uploaded easily. So now what I'm thinking is to run another program first that calls my main program and then closes it after a certain time. I tried a simple .bat script that was able to successfully open the program, but it couldn't close/kill the process due to access denied errors (worked locally). Any other quick suggestions that'll work in a web job environment?
Obviously if you see this here in a few days, I've probably already made corrections to the source code at the root of the issue, but others may be interested as well. :)
Thank you to everyone! Each of these solutions helped me to get my web job running as intended. The decompiling using Reflector was especially useful so that I can add this project to the cloud like its suppose to be. However, using the run.cmd as suggested by @evilSnobu was the easiest and simplest way to apply a workaround as requested in my question.
Again thank you! :)
P.S. I switched from
System.Threading.Thread.Sleep(); to prevent any future mishaps.