ProjectServer.OpenProject fails in Taskscheduler

Hi,

while running my Trados app by double click, app works as expected. 

But as soon as I put this task to Windows Task-Scheduler, ProjectServer.OpenProject raises an Exception:

Code:

var tradosProjectServer = new Sdl.ProjectAutomation.FileBased.ProjectServer(this.Host, false, this.UserName, this.Password);
string projectId = myProjectId;
var project = tradosProjectServer.OpenProject(new Guid(projectId), workFolder);

Exception:

There was an error opening the server project
   at Sdl.ProjectAutomation.FileBased.ProjectServer.OpenProject(Guid projectId, String localProjectFolder)

While any other things like working with local projects work as expected, here app fails.

Is there an issue with this function, when process is running without UI?

 

Credentials: checked

 

Thoughts? Thanks

Markus

Parents
  • Hi  

    I have not been able to reproduce the issue that you signalled above.  Please confirm that the steps I followed correspond to yours, to rule out that I missed something, as follows:

    Steps

    1. Open your console solution in Visual Studio as Administrator
      Note: the solution is simply a connection to the project server + open a project
      Example:
      • var server = new Sdl.ProjectAutomation.FileBased.ProjectServer(host, false, user, password);
      • var project = server.OpenProject(new Guid(projectId), workFolder);
    2. Set the output path of the solution to the Studio5 installation directory
    3. Compile + close the solution.
    4. Create a new Task from the windows Task Scheduler
      • Security: I used my windows user credentials (already logged in)
      • From the actions tab, select the new executable file that was built in the studio installation directory.
      • From the triggers, indicate the conditions that will trigger the task. I simply chose to run once at a specific time.
      • All other settings are default
    5. Click 'OK' to save the Task.

     I wonder is the issue related to security; possibly select the option 'Run with hightes privileges'?

  • Hi Patrick,

    now I found out, what's the real problem, as after a while I got same issue with the newly created user.

    This issue happens, when %temp% is filled up with 65536 files. As soon as %temp% reaches this amount of temp files this exception is thrown.

    Cleaning up %temp% solved the issue.

    Just need to check why there are so many files in %temp%, but I think it's not a Trados issue.

    Thanks again and hope this info is useful for others

    Markus

  • Short update...
    It seems Trados 2017 produces this temp-files. As our process is more complex I can't tell you, in which steps.
    But it seems Trados or its API calls Path.GetTempFileName on certains points. temp-files often have a size of 0kb. Any time one call Path.GetTempFileName this functions creates this file directly, so after every call this file has to be deleted again.
    I also noticed this effect when creating a project in Trados by hand, but not with so much files.
    Perhaps you can double check your Code. Meanwhile I'll create an other scheduled Task which cleans up %temp% Directory once a day.
    Markus
Reply Children