Is there a way to check if the project already contains TM?

After creating a project, we would normally add TM, but if the project template already have TM associated, then following error occurs:  

Inner Exception: System.ArgumentException: The combination of Uri and State properties for the main translation providers should be unique within the list of entries.

So, before adding TM, is there a way to check if the project already contains associated TM?

Thank you!
Rieko

Parents
  • Dear Rieko,

    The function "GetTranslationProviderConfiguration" (to be applied to your filebasedproject), will return all the TMs which are already associated to your project, including those coming from the template.

    Regards,

    Laurent

  • Dear Laurent,

    The template I use includes TMs that I would like to use, but following message comes back from RunAutomaticTask: File Analysis

    Unexpected exception when initializing task 'File Analysis': Failed to create an instance of translation provider 'sdltm.http://sdlgroupshare/?orgPath=/Localization NIC&tmName=LV - French - Main Server TM'..

    What could I be doing wrong here?

    Thank you,

    Rieko

  • Dear Rieko,

    Difficult to say what is going wrong. Do you manage to create your project without running the analysis task?

    If yes, I would suggest that you create the project and then try to run the analysis task directly in Studio. This will help you to find out whether the problem is in your code or on the server side?

    Do you only get this error message for the TM you mention? Is the mentioned TM the first one in the list/ sub-organisation?

    Laurent

  • Hi Laurent,

    The project is created fine.

    When I ran analysis task directly in Studio, it works fine.  It is interesting that Task History tab say that Analyze Files ran from the code caused an error.

    But even if I look at the task results, it does not give me much information...

    Mentioned TM is the first one in the list/sub-organization.  The TM the code trying to use is third one in the list.

    I really appreciate any other questions or information that might help me to solve this problem!

    Thank you,
    Rieko 

  • Hi, Rieko,

    We had exactly the same problem with a custom application. The "Analyze" task works fine from Studio but it showed that error when trying to run the ask from the API.

    In our case the solution was to copy a config file with the same name as the EXE to the Studio3 folder (where the exe file of our custom app was running).

    This config file has this content:

    <?xml version="1.0"?>

    <configuration>

    <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

    </startup>

    </configuration>

    With this config file in place, we don't get the error. I understand that this config file is created automatically with VisualStudio when you compile your project and it has to have the same name as the executable file with the .config extension.

    I hope this helps!

    Daniel

Reply
  • Hi, Rieko,

    We had exactly the same problem with a custom application. The "Analyze" task works fine from Studio but it showed that error when trying to run the ask from the API.

    In our case the solution was to copy a config file with the same name as the EXE to the Studio3 folder (where the exe file of our custom app was running).

    This config file has this content:

    <?xml version="1.0"?>

    <configuration>

    <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

    </startup>

    </configuration>

    With this config file in place, we don't get the error. I understand that this config file is created automatically with VisualStudio when you compile your project and it has to have the same name as the executable file with the .config extension.

    I hope this helps!

    Daniel

Children