How to load ScriptableObject from asset file immediately?

I’m loading an asset inside custom editorwindow script and nomatter what, it always on the first load returns null. I’ve tried to wait with update loop for it to load, I’ve tried recalling the load in update, no effect, only way is to get editor rebuild the assembly. Unfortunately i haven’t found a way to force the assembly rebuild.

Asset loading code:

    public static bool GetAssetFile<T>(out T asset, string filter = "DefaultAsset l:noLabel t:noType") where T : ScriptableObject
    {
        bool found = false;
        string[] guids = AssetDatabase.FindAssets(filter);
        if(guids.Length > 0)
        {
            found = true;
            string assetPath = AssetDatabase.GUIDToAssetPath(guids[0]); // only one loaded
            asset = AssetDatabase.LoadAssetAtPath(assetPath, typeof(T)) as T;
        }
        else
            asset = null;

        return found;
    }

If you have any insight how to refresh, reload the asset correctly or how to workaround this, I would appreciate it alot. Thank you verymuch beforehand.

The problem was that, the classes derived from ScriptableObject were nested classes. Took them out of the class and put them into correspondingly named .cs files and it started to work as supposed. For some reason though, it could locate them on second assembly build.