Issue with RunAutomaticTask after upgrading to Trados 2024

Dear Developer Community,

 

We recently upgraded our automation, developed using the .NET SDK, from Trados Studio 2021 to Trados Studio 2024.

 

After the upgrade, the following function in FileBasedProject, which works without issues in the 2021 version, now causes an error:

 

AutomaticTask projectTmTask = project.RunAutomaticTask(

    targetFiles.GetIds(),

    AutomaticTaskTemplateIds.PopulateProjectTranslationMemories,

    (sender, taskStatus) => {

        update_action_status(position_trados_action_id, sender, taskStatus, position_counter, position_count);

    },

    (sender, scanMessage) => {

        update_action_message(position_trados_action_id, sender, scanMessage);

    }

);


The error is: Unable to find the specific file. We assume that the projectTM (file based) can not be created.

Has there been a change in this method’s usage or parameters in the 2024 SDK?

Are there any known adjustments required when upgrading this functionality?


We are still using the project template from Trados Studio 2021 that we have been using before. Should we update it?

Here is a screenshot that shows the error from Visual Studio:

Visual Studio HTML Visualizer showing an error message: Unable to find the specified file.

 

Looking forward to any feedback!



Generated Image Alt-Text
[edited by: RWS Community AI at 3:51 PM (GMT 1) on 17 Jul 2025]
Parents
  • We analyzed the issue with the Trados Connector 2024 in detail this weekend.
    It turns out that the project TM is created incorrectly by Trados 2024. With the same configuration, everything works perfectly in Trados 2021.

    We isolated the API function for project TM creation from Trados and performed various tests with modified configurations to systematically rule out possible causes.
    The following insights were gained:

    • The project template as well as project parameters (e.g., TM search depth) have no influence on the issue.
    • Without an attached TM, the project can be created without problems.
    • As soon as a TM is attached, the creation of the project TM fails. It does not matter which TM is used.
    • In a test scenario where an empty project TM should be created, we executed the same action with both Trados 2021 and 2024:
      • In both cases, a TM with exactly the same file size of 456 KB (466,944 bytes) is created.
      • Both files are shown as ANSI-encoded in Notepad++.
      • However, comparing the files in Notepad++ shows they are different.
      • The TM from Trados 2021 can be opened as expected and is empty (as it should be).
      • The TM from Trados 2024 cannot be opened: the attempt to open it ends in an unspecific error.

    Here the TMs from Trados 2021 and 2024:

    TMs.zip

    We checked all packages again, and they are from Trados 2024 and the latest we could find.
    This allows us to rule out issues with write permissions or file paths.
    We suspect the TM created by Trados 2024 is corrupted.

     

    Does anyone have any ideas or suggestions?

  • Hi  , I've taken some time to review this again this morning and confirm that it is working as expected. 

    I've modified the sample project to demonstate this here: https://github.com/RWS/Sdl-Community/tree/master/Code%20samples/ProjectAutomation.  Please download and test with this sample project.  You simply need to update the TODO's in the program.cs to map to yr local directory/resource files.
    Important: remember to run this as an administrator when compiling the project as the Ouput is pointing to the installation directory of Trados Studio.

    Example:
    Code snippet showing a C# program with TODO comments for setting source files, project output folder, language combination, and memory resource path.

    I've added a new function in the sample project to demonstrate how to call automation task 'PopulateProjectTranslationMemories', here for example:

    Code snippet showing automation tasks in C# for Trados Studio, with a console output window displaying task statuses such as 'scan: Completed' and 'Done!'.

    Can you test this again and let me know if you are still having problems.  Might be useful to provide access to the source code where you can reproduce the problem from your computer.



    Generated Image Alt-Text
    [edited by: RWS Community AI at 11:03 AM (GMT 1) on 23 Jul 2025]
  • Hi  , thank you for your message and updated project template.

    We tested (as admin) your template using our Groupshare server TMs, and the problem persists (RunPopulateTranslationMemories = Failed). When trying the same code and same server TM with Trados 2021, then it works. The problem is only with Trados 2024.

    Here a snippet of our only difference from your code (the rest is identical):

    Code snippet showing a JavaScript object for setting a memory resource with variables for source and target languages, and a commented example of a file-based TM path.

    Looking forward to your help



    Generated Image Alt-Text
    [edited by: RWS Community AI at 8:01 AM (GMT 1) on 24 Jul 2025]
Reply Children
  • Hi  , Understood -> so the issues you were experiencing are occuring when you're specifically working with a GroupShare resource. It would be useful to also have the exception details to help track down why it's failing on your system.

    I have tested this scenario here and is working as expected.  However, I did notice an issue with loading the assembly  'System.Text.Json, Version=8.0.0.3'.

    Try this:
    Add a binding redirect to resolve the assembly version expected by Trados Studio 2024 to your app.config file of the code project.

          <dependentAssembly>
            <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-8.0.0.4" newVersion="8.0.0.4" />
          </dependentAssembly>

    Full app.config contents for reference:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
      </configSections>
      <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
      </startup>
      <runtime>
        <NetFx40_PInvokeStackResilience enabled="1" />
        <legacyCorruptedStateExceptionsPolicy enabled="true" />
        <ThrowUnobservedTaskException enabled="true" />
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Extensions.DependencyModel" publicKeyToken="adb9793829ddae60" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.SqlClient" publicKeyToken="23ec7fc2d6eaa4a5" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <Paket>True</Paket>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="13.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-8.0.0.4" newVersion="8.0.0.4" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      
      <log4net>
        <!-- Set levels to DEBUG for extended logging information -->
        <appender name="RollingFile" type="Sdl.Desktop.Logger.LocalUserAppDataFileAppender, Sdl.Desktop.Logger">
        </appender>
        <!-- output to debug string -->
        <appender name="OutputDebug" type="log4net.Appender.OutputDebugStringAppender">
          <layout type="log4net.Layout.PatternLayout">
            <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
          </layout>
        </appender>
        <root>
          <level value="INFO" />
          <appender-ref ref="RollingFile" />
          <appender-ref ref="OutputDebug" />
        </root>
        <logger name="Sdl.TranslationStudio">
          <level value="INFO" />
        </logger>
        <logger name="Sdl.Desktop">
          <level value="INFO" />
        </logger>
        <logger name="Sdl.ProjectApi">
          <level value="INFO" />
        </logger>
        <logger name="Licensing">
          <level value="INFO" />
        </logger>
        <!--<logger name="Sdl.MultiTerm">
          <level value="DEBUG"/>
        </logger>-->
      </log4net> 
    </configuration>