"Exception has been thrown by the target of an invocation." following the Sample Translation Service Provider Plug-in example

Hi all, 

I'm following the Sample Translation Service Provider Plug-in example and I got an "Exception has been thrown by the target of an invocation." error at MyTranslationProviderWinFormsUI.get_TypeName() when I create a new project, add a file and click on "Next".

I'm using SDL Trados 2017 with Visual Studio 2017.

I have no idea why, if someone can help me please.

Thanks, 

Matthieu

Parents Reply Children
  • Hi Andreas, 

    I'm a beginner in C# and SDL Trados API development so I am maybe wrong but it seems that this portion throws the error : 

    namespace SDL_Translation_Provider2
    {
    [TranslationProviderWinFormsUi(Id = "Translation_Provider_Plug_inWinFormsUI",
    Name = "Translation_Provider_Plug_inWinFormsUI",
    Description = "Translation_Provider_Plug_inWinFormsUI")]
    class MyTranslationProviderWinFormsUI : ITranslationProviderWinFormsUI
    {
    #region ITranslationProviderWinFormsUI Members

    public ITranslationProvider[] Browse(IWin32Window owner, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
    {
    throw new NotImplementedException();
    }

    public bool Edit(IWin32Window owner, ITranslationProvider translationProvider, LanguagePair[] languagePairs, ITranslationProviderCredentialStore credentialStore)
    {
    throw new NotImplementedException();
    }

    public bool GetCredentialsFromUser(IWin32Window owner, Uri translationProviderUri, string translationProviderState, ITranslationProviderCredentialStore credentialStore)
    {
    throw new NotImplementedException();
    }

    public TranslationProviderDisplayInfo GetDisplayInfo(Uri translationProviderUri, string translationProviderState)
    {
    throw new NotImplementedException();
    }

    public bool SupportsEditing
    {
    get { throw new NotImplementedException(); }
    }

    public bool SupportsTranslationProviderUri(Uri translationProviderUri)
    {
    throw new NotImplementedException();
    }

    public string TypeDescription
    {
    get { throw new NotImplementedException(); }
    }

    public string TypeName
    {
    get { throw new NotImplementedException(); }
    }

    #endregion
    }
    }

  • Hi Matthieu,

    probably not. So far, this portion does basically nothing but throw an error "I have not been implemented yet".

    It is probably some portion with a condition like this:
    "if(abc.getType() == (typeof(xyz))"

    ...or similar.