Loading or not loading a new project created through the automation APIs

I'm using the automation APIs to write a Trados plugin which creates projects (and optionally packages).

Here is a summary of the code I use to create the project.

var createdProject = new FileBasedProject(settings.ProjectInfo, new ProjectTemplateReference(settings.Template.FullName));

createdProject.AddFolderWithFiles(diFiles.FullName, true);

RunTasks(createdProject, settings);

createdProject.Save();

CreateProjectPackage(createdProject, settings);

Once created, the project is not listed on the Projects view. If I try to open the project in Trados I'm told...

Information dialog box in SDL Trados Studio 2017 stating 'This project has already been opened in SDL Trados Studio 2017 and added to the project list.' with an OK button.

The project is not listed in the ~\Documents\Studio 2017\Projects\projects.xml file. I get the same message if I try to open the package.

However, if I close and re-open Trados I can open the project without any problem.

So why does Trados think that the project has been loaded? Is there a way to only conditionally load the project? Ideally I'd like the plugin to present this as an option to the user (for internal business reasons the person creating the package may not be the person who works with the package).



Generated Image Alt-Text
[edited by: Trados AI at 1:05 PM (GMT 0) on 5 Mar 2024]
Parents Reply
  • I hadn't, but having just tried it now it makes no difference.

    I've also clicked 'Refresh View' on the View menu and again, no difference. The project doesn't appear but Trados won't allow me to manually open it.

    Besides, if it were just a case of refreshing the view then I would expect the project to be listed in projects.xml, but it isn't. It seems like the top-level Trados Studio application maintains a different list of projects than projects.xml.

Children
No Data