c# - Azure Web Jobs failure - ReadLine() left in -


so created azure web job performs task every 15 mins. runs c# console application. problem on last upload of program left console.readline(); argument in, causing program never finish (used local debugging of course) , web job fail , never run again. can fixed real quick if had source code, source code @ office, forgot upload cloud storage. won't have access till bit later on week.

so i'm looking quick fix. can download .exe program last uploaded easily. i'm thinking run program first calls main program , closes after time. tried simple .bat script able open program, couldn't close/kill process due access denied errors (worked locally). other quick suggestions that'll work in web job environment?

obviously if see here in few days, i've made corrections source code @ root of issue, others may interested well. :)

update:

thank everyone! each of these solutions helped me web job running intended. decompiling using reflector useful can add project cloud suppose be. however, using run.cmd suggested @evilsnobu easiest , simplest way apply workaround requested in question.

again thank you! :)

p.s. switched console.readline(); system.threading.thread.sleep(); prevent future mishaps.

public class program     {         public static void main()         {             console.writeline("hello world!");             console.readline();             console.writeline("after readline");         }     } 

try running webjob echo '\n' | helloconsole.exe

testing in kudu:

d:\home\tmp>echo '\n' | helloconsole.exe hello world! after readline  d:\home\tmp>echo '\n' | helloconsole.exe hello world! after readline 

..seems pull off.

if drop in run.cmd have precedence on .exe binary. https://github.com/projectkudu/kudu/wiki/web-jobs

we use following logic decide file script run within job's directory:

  • per file type first file named: run.{file type extension} (for example run.cmd or run.exe).

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -