Sdl.ProjectAutomation.FileBased.LicensingException

I develop a console app using SDL 2024 API, and want to use it for data engineering.

                // Load existing project
                var existingProjFile = Directory.EnumerateFiles(config.ProjectPath, "*.sdlproj").FirstOrDefault();
                FileBasedProject loadedProject = new FileBasedProject(existingProjFile);

                Log.Information($"Loaded project: {loadedProject.FilePath} from {existingProjFile}");

But in many times, it reported error:

Exception: Error: Unhandled Exception: Sdl.ProjectAutomation.FileBased.LicensingException: License check failed, with exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Sdl.ProjectApi.Licensing.StudioApplicationLicenseManager.get_ApplicationLicenseManager()
at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense() ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Sdl.ProjectApi.Licensing.StudioApplicationLicenseManager.get_ApplicationLicenseManager()
at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense()
--- End of inner exception stack trace ---
at Sdl.ProjectAutomation.FileBased.FileBasedProject..ctor(String projectFilePath)
at GenerateTargetTranslations.Program.Main()

Could help me understand what is problem?