How to use OnWIllDeleteAsset - Not being called

I’m currenty trying to find a way around using .net FileSystemWatcher as when a file delete callback is sent its too late to get anything from the object. I found out about AssetModificationProcessor and its OnWillDeleteAsset and its just what i need, but i cannot impliment it so far i have this;

[InitializeOnLoad]
public class ObjectDatabaseEditor : UnityEditor.AssetModificationProcessor {
    //

   public static AssetDeleteResult OnWillDeleteAsset(string AssetPath, RemoveAssetOptions rao)
    {
        Debug.Log("deleted - unity callback: " + AssetPath);

        return AssetDeleteResult.DidNotDelete;
    }

    //
}

But it does not get called.

Hey,
It’s a bit late but I also ran into this issue and I think I figured out.
Unfortunately, if I read the source file correctly at lines 216-217, the:
if (!InternalEditorUtility.HasTeamLicense())
return finalResult;
prevents your AssetModificationProcessor from calling OnWillDeleteAsset if you don’t have a Team License. I left a feedback on their doc page, they should precise that.