File TM could not be instantiated. File or assembly Microsoft.Sql.Client not found when automating project creation

I am getting the error from the Subject when programmatically creating a project with the Studio 2022 API. It's working when you create the project manually with any file TM.

It is working fine with Server TMs. With file TMs, the project is created, but the analysis report is not executed because of the above error.Error dialog showing 'Unexpected exception when initializing task 'Analyse': The translation engine 'sdltm.file' could not be initialized.' with additional details in German about the engine and missing Microsoft.Data.SqlClient assembly.

Below is an outline on of the source code. Any idea on how to resolve this?

    ProjectTemplateReference obj_Project_Template = new ProjectTemplateReference(@"C:\test file tm.sdltpl");

    FileBasedProject _proj = new FileBasedProject(GetProjectInfo(), obj_Project_Template);

            _proj.AddFolderWithFiles(@"C:\docs\", false);

            _proj.RunAutomaticTask(_proj.GetSourceLanguageFiles().GetIds(), AutomaticTaskTemplateIds.Scan);

            _proj.RunAutomaticTask(_proj.GetSourceLanguageFiles().GetIds(), AutomaticTaskTemplateIds.CopyToTargetLanguages);

            _proj.RunAutomaticTask(_proj.GetTargetLanguageFiles().GetIds(), AutomaticTaskTemplateIds.AnalyzeFiles);



Generated Image Alt-Text
[edited by: RWS Community AI at 10:53 AM (GMT 1) on 13 Aug 2024]
Parents Reply Children
No Data