<SettingsGroup Id="TranslationMemoryUpdateTaskSettings"> missing from sdlproj file

Related to https://community.sdl.com/products-solutions/solutions/customer_experience_cloud/language/language-developers/f/57/t/8389, when I import projects through the API, the element with id "TranslationMemoryUpdateTaskSettings" is missing from the sdlproj file, so when I try to get it via

updateTMSettings.GetSetting<string>("TmImportOptions").Value = "KeepMostRecentTranslation";
settings.UpdateSettings(updateTMSettings);

 I get this stacktrace

My.Program.Main(:0): System.InvalidCastException: Unable to cast object of type 'Sdl.ProjectApi.Settings.SettingTypes.TmImportOption' to type 'System.String'.
   at Sdl.Core.Settings.SettingsGroup.GetSetting[T](String settingId)
   at My.PackageImport.GetTmUpdateTaskSettings(FileBasedProject project)
   at My.PackageImport.ImportPackage(List`1 projectPackageFiles, List`1 returnPackageFiles)
   at My.Program.Main(String[] args)

 Is there any way to set the TmImportOptions if it doesn't exist, or do I have to manually modify the sdlproj XML file?

Parents
  • Hello!

    Having played with settings (of my custom plugin) via .sdlproj files, I discovered a strange thing:

    If a setting has been set to its default value, then it doesn't appear in .sdlproj file. If you set it to some other value, then .sdlproj would keep this information. Moreover, if all of the settings in a given SettingsGroup have their default values, the whole group would disappear from .sdlproj file. It's rather counter-intuitive, but that's the way it is.

Reply
  • Hello!

    Having played with settings (of my custom plugin) via .sdlproj files, I discovered a strange thing:

    If a setting has been set to its default value, then it doesn't appear in .sdlproj file. If you set it to some other value, then .sdlproj would keep this information. Moreover, if all of the settings in a given SettingsGroup have their default values, the whole group would disappear from .sdlproj file. It's rather counter-intuitive, but that's the way it is.

Children
No Data