net core 3.1 if file exists code example Example: c# file exist if (File.Exists("file.exe")) { //file exist } else { //does not exist }