there is no else to go along with this if
if (File.Exists(file) == true)
if it is false, nothing is returned. So you need to add a return false at the end.
if (File.Exists(file) == true)
{
...
}
return false;
When your method executes it is expected to return the type you defined. In your case when the method is called, it is expected to return a boolean. When the code execution path goes into your if statement, it is fine because it returns a boolean. If the code does NOT go into the if, that your code does not return anything. That is the error. Walk through the code with pencil and paper and see how it executes.