That code won't even compile, much less generate a run time error:
var date = DateTime.Now.Date.ToShortDateString;
Will give you an error:
Cannot assign method group to an implicitly-typed variable
You need to start by correcting that - add the brackets to call the method:
var date = DateTime.Now.Date.ToShortDateString();
Now your code will maybe compile - and you won't be running the old version of the code ...