System.MissingMethodException when calling TranslationProviderManager.GetTranslationProviderFactories() - plugin problem

Hello!

After upgrading Trados Studio from version 17.0.3.11695 to 17.2.8.18668 we have a problem with Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderManager.GetTranslationProviderFactories() method.

When calling it we get this error:

System.MissingMethodException: No parameterless constructor defined for this object.
  at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
  at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
  at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
  at System.Activator.CreateInstance(Type type, Boolean nonPublic)
  at System.Activator.CreateInstance(Type type)
  at Sdl.Core.PluginFramework.DefaultObjectResolver.CreateObject(Type objectType, XElement attributeElement)
  at Sdl.Desktop.Platform.Implementation.ObjectResolverComposer.CreateObject(Type objectType, XElement attributeElement)
  at Sdl.Core.PluginFramework.Implementation.Extension.CreateInstance()
  at Sdl.Core.PluginFramework.ObjectRegistry`2.CreateObjects()
  at Sdl.LanguagePlatform.TranslationMemoryApi.TranslationProviderManager.GetTranslationProviderFactories()

We've discovered that the problem is caused by this file located in PlugIns directory:
Sdl.BestMatchService.TranslationProvider.plugin.xml

Very simple console app like this is enough to induce the error:

using Sdl.LanguagePlatform.TranslationMemoryApi;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            TranslationProviderManager.GetTranslationProviderFactories();
        }
    }
}

A workaround to this problem is to delete first two <extension>...</extension> sections from Sdl.BestMatchService.TranslationProvider.plugin.xml.

Uprading to 17.2.10.19084 doesn't help.

Is there more proper solution to this problem?

Cheers,
Wojtek

  • Hi , thank you for reporting this. I confirm that this is a problem for standalone applicaitons only.  The development team will need to review it and then confirm if a solution can be provided.  I don't have a work around for this.

    Adding ,  

  • Thank you for bringing this to our attention. Our development team will review it in the context of our ongoing projects and priorities. Your understanding and patience as we assess this matter is appreciated. We have recorded the issue in our tracking system under the reference number CRQ-38812
  • Thank you for answering. When do you think we can expect the problem to be reviewed and possible solution confirmed?

  •  I have one more question - do you think that the workaround I proposed to delete first two <extension>...</extension> sections from Sdl.BestMatchService.TranslationProvider.plugin.xml or deleting whole Sdl.BestMatchService.TranslationProvider.plugin.xml file can cause any problems?

  • Hi ,  The development team have reported that there will be a fix in place for the Trados Studio 2022 SR2 CU11 and 2024 CU1.

    Until then, you can use this workaround.

    1. Add a reference to Sdl.ProjectAutomation.FileBased to your project.
    2. Add this reflection helper to your code. This helper includes a method to call a private static method in FileBasedProject assembly.
    3. Call the helper method CallEnsurePluginRegistryIsCreated once, before the factory methods.

      Full code example here:
  • That's great! Thank you.
    The workaround helps in our project! Thanks!