title: c# console application stays on status running in task scheduler windows 2016
body: <p>I made a simple c# .net console application. It's a backup script to copy a file to another folder and add the date to the the filename to keep it unique. The script runs perfectly.</p>
  
  <p>However when I schedule it in Windows task scheduler, its status will stay on "running" after started while the application closed already.</p>
  
  <p>I tried ending the main function with an int return value of 0
  and I tried to have "System.Environment.Exit(0);" as last line of the application.
  I also removed all other code just leaving the exit code on to make sure the error was not in my code.</p>
  
  <p>The checkbox "If the running task does not end when requested, force it to stop" is enabled.</p>
  
  <p>All this didn't solve the problem.</p>
  
  <p>I'm running windows server 2016</p>
  
  <p>Anyone know how I can solve this problem?</p>