It's prematurely exiting the program since it doesn't wait for the end of the execution I guess. (see e.g. http://stackoverflow.com/a/15149840/5296568https://stackoverflow.com/a/15149840/5296568)
Change
public static async void Gettasks() To
public static async Task Gettasks() Then await the end of the execution.
static async void Main(string[] args) { await Gettasks(); } Edit: Ahem, so it turns out that Main cannot be async. So maybe for now just confirm that this method get's called properly until the end by blocking the thread.
static void Main(string[] args) { Gettasks(); Console.ReadLine(); //just don't press enter immedietly :) }