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