Hi,
I am developing C# program with GenerateTargetTranslations API. But it does not work well and shows the following error message:
Error Message:
Could not find task template with ID Sdl.ProjectApi.AutomaticTasks.GenerateTargetTranslation} ---> System.ArgumentException: Could not find task template with ID Sdl.ProjectApi.AutomaticTasks.GenerateTargetTranslation
How can I fix it? Relevant source code is below:
Source Code :
================
public void GenerateTranslatedFile() {
string projectPath = PathExtensions.GetWorkTempDirPath(translationRequestInfo, AutomateConstants.WORK_TEMP_SVNWORK, AppConfig.GetInstance().GetWorkProject());
string projectFilePath = String.Format(@"{0}\{1}{2}", projectPath, AppConfig.GetInstance().GetWorkProject(),AutomateConstants.TRADOS_PROJECTFILE_EXTENSION);
newProject = new FileBasedProject(projectFilePath);
var files = newProject.GetTargetLanguageFiles();
AutomaticTask generateTraslatedTask = newProject.RunAutomaticTask(newProject.GetTargetLanguageFiles().GetIds(), AutomaticTaskTemplateIds.GenerateTargetTranslations);
newProject.UpdateProject(newProject.GetProjectInfo());
newProject.Save();
}
================
That code works well in the Visual Studio 2013 debug environment but does not work in the execution environment. Could you let me know the cause and solution? Thank you.
I also add the stack trace below:
Stack Trace:
================
Could not find task template with ID Sdl.ProjectApi.AutomaticTasks.GenerateatTranslation} ---> System.ArgumentException: Could not find task template with ID Sdl.ProjectApi.AutomaticTasks.GenerateatTranslation
at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)
at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId)
at PSW.CMS.Automate.TradosProject.GenerateTranslatedFile() at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\TradosProject.cs:Line 177
--- StarckTrace ---
at PSW.CMS.Automate.TradosProject.GenerateTranslatedFile() at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\TradosProject.cs:Line 204
at PSW.CMS.Automate.Bootup.RunPostprocessing(TranslationRequestInfo translationRequestInfo) at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\Bootup.cs:Line 486
at PSW.CMS.Automate.Bootup.RunProcessing(Dictionary`2 cmdParams) at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\Bootup.cs:Line 388 2014-09-24 15:51:05,486 [136] ERROR SystemLogger - [CAUTE00012]CAUTE00012{Could not find task template with ID Sdl.ProjectApi.AutomaticTasks.GenerateTargetTranslation} System.ArgumentException: Could not find task template with ID Sdl.ProjectApi.AutomaticTasks.GenerateTargetTranslation
at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId, EventHandler`1 statusEventHandler, EventHandler`1 messageEventHandler)
at Sdl.ProjectAutomation.FileBased.FileBasedProject.RunAutomaticTask(Guid[] projectFileIds, String taskTemplateId)
at PSW.CMS.Automate.TradosProject.GenerateTranslatedFile() at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\TradosProject.cs:Line 177 2014-09-24 15:51:05,487 [136] ERROR SystemLogger -
at PSW.CMS.Automate.TradosProject.GenerateTranslatedFile() at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\TradosProject.cs:Line 204
at PSW.CMS.Automate.Bootup.RunPostprocessing(TranslationRequestInfo translationRequestInfo) at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\Bootup.cs:Line 486
at PSW.CMS.Automate.Bootup.RunProcessing(Dictionary`2 cmdParams) at c:\Users\Administrator\Documents\Visual Studio 2013\Projects\Automate\develop\Automate\Automate\Bootup.cs:Line 388
================
Thanks,
Takahiro