MenuItem button disabled when using System.IO

Have created MenuItem button for resetting my game save. When I add “using System.IO” directive, then the button is disabled and I cannot click it. When I remove System.IO, and will leave just a Debug.Log inside, everything works. Whats wrong, can I even do what I want?

Here is the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;

public class ResetGameSave : EditorWindow {

    [MenuItem("File/Reset Game Save")]
    static void Reset() {
        Debug.Log("Resetting game save from editor");
        File.Delete(Loader.SaveFilePath);
    }

}

I put your script in a new project, and was unable to replicate your issue. The menu item always remains enabled, even with the System.Io in place.
One thing I DID change was that I used a hard-coded path, rather than your “Loader” class.

I would start by confirming this works for you in a blank project as well. If it gives you problems there to, I would suspect system some kind of system-specific issue, perhaps OS or unity install related.

If it works fine in a new project, that’s a good indicator that something ELSE in your main project is messing this up. Copying each component to your new project, one at a time, until the error replicates, is one way to figure out what part of your project is messing up.