HI , This error seems to occur at random . Once I create the asset ,everything is fine . Sometime when there is a assembly reload I get this error and sometime I don’t get the error , heck sometimes i get the error then it goes away … same thing whenever i close and restart Unity.
Here is my code for creating this asset where Comp is the Class which inherits from ScriptableObject
var asset = ScriptableObject.CreateInstance<Comp>();
AssetDatabase.CreateAsset(asset,"Assets/NewFolder/Comp.asset");
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();