Unity doesn't recognise UnityEditor.Build.Reporting;

Hello, I’m trying to access UnityEditor.Build.Reporting; in order to auto-delete save files and settings files created during testing when the app is built. However, while I can find the right interfaces in UnityEditor.Build.Reporting;, Visual Studio gives me an error. Any idea why?

#if UNITY_EDITOR
class MyCustomBuildProcessor : IPreprocessBuildWithReport
{
    public int callbackOrder { get { return 0; } }
    public void OnPreprocessBuild(BuildTarget target, string path)
    {
        // Do the preprocessing here
    }

    public void OnPreprocessBuild(BuildReport report)
    {
        throw new NotImplementedException();
    }
}
#endif

image

wrap the using namespaces with the #if UNITY_EDITOR as well , or just wrap the entire content of the file