I want to do some simple debugging, and Console.Writeline no longer seems to be supported by Azure WebJobs.
I know using a TextWriter class is the answer, and I just inject it into my method. What I don't understand is how I call that method. I cannot invalidate my Main method signature and inject it there.
What am I missing please?
public static void Main(TextWriter log)
{
//This is is not valid
}
For continous webjob, you can do it like that :
class Program
{
private static void Main()
{
var host = new JobHost();
host.Call(typeof(Program).GetMethod("Start"));
host.RunAndBlock();
}
[NoAutomaticTrigger]
public static void Start(TextWriter textWriter)
{
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With