API exception on Sdl.ProjectApi.AutomaticTasks.AbstractTaskReport.AddSettings() after updating to

Hi,

I've just updated my SDL Trados installation to "SDL Trados Studio 2017 SR1 14.1.100009.15268" and now when I run the unit tests for our application that use Studio's API, I get and error:

{"Unexpected exception when configuring file multiFileConverter for task 'Analyze Files': Method not found: 'Void Sdl.ProjectApi.AutomaticTasks.AbstractTaskReport.AddSettings(System.Xml.XmlElement, Sdl.ProjectApi.Settings.TranslationMemorySettings)'.."}

when calling FileBasedProject.RunAutomaticTask().

That error seems to cause a null pointer and then the analysis crashes.

The code and the files have not changed at all (it's a unit test): the only difference between the test passing yesterday and failing today is the updated installation.

Here is the code up to the call that throws the exception:

public void RunAnalysisReport(FileBasedProject project,
string target,
string outputDir,
bool reportCrossFileRepetitions,
bool reportInternalFuzzyMatchLeverage,
bool excludeLockedSegments,
bool reportLockedSegmentsSeparately,
bool exportUnknownSegments,
int unknownSegmentsMaxMatchValue,
bool outputExcelReport)
{
logger.Info("Analysis report for "+target+"...");
Language trgLang = MapLanguage(target);
ISettingsBundle settings = project.GetSettings(trgLang);
AnalysisTaskSettings opt = settings.GetSettingsGroup<AnalysisTaskSettings>();
opt.ReportCrossFileRepetitions.Value = reportCrossFileRepetitions;
opt.ReportInternalFuzzyMatchLeverage.Value = reportInternalFuzzyMatchLeverage;
opt.ReportLockedSegmentsSeparately.Value = reportLockedSegmentsSeparately;
opt.ExcludeLockedSegments.Value = excludeLockedSegments;
opt.ExportUnknownSegments.Value = exportUnknownSegments;
opt.UnknownSegmentsMaximumMatchValue.Value = unknownSegmentsMaxMatchValue;
project.UpdateSettings(trgLang, settings);

logger.Info("ReportCrossFileRepetitions: " + opt.ReportCrossFileRepetitions.Value);
logger.Info("ReportInternalFuzzyMatchLeverage: " + opt.ReportInternalFuzzyMatchLeverage.Value);
logger.Info("ReportLockedSegmentsSeparately: " + opt.ReportLockedSegmentsSeparately.Value);
logger.Info("ExcludeLockedSegments: " + opt.ExcludeLockedSegments.Value);
logger.Info("ExportUnknownSegments: " + opt.ExportUnknownSegments.Value);
logger.Info("UnknownSegmentsMaximumMatchValue: " + opt.UnknownSegmentsMaximumMatchValue.Value);

ProjectFile[] targetFiles = project.GetTargetLanguageFiles(MapLanguage(target));
AutomaticTask analyzeTask = project.RunAutomaticTask(targetFiles.GetIds(),
      AutomaticTaskTemplateIds.AnalyzeFiles);
StopOnError(analyzeTask.Messages);

Maybe there is a parameter that is now required but wasn't before?

Any pointer on a workaround would be appreciated.

Thanks,
-yves

Parents Reply Children