Could not load file or assembly 'Microsoft.Extensions.DependencyInjection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

Hi,

We provide the plugin using Batch Task API for Trados Studio 2021, and our customer reported above error.

Our plugin works less than 2021 SR1 CU4 or 6, but crashes with Studio self at 2021 SR1 CU8(7?).

In my investigation, it seems to add some "assemblyBinding" settings to SDLTradosStudio.exe.config of 2021 SR1 CU8.

Would you able to remove these settings which prevents our plugin?

The settings corresponding our plugin are here:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.1" newVersion="5.0.0.1" />
</dependentAssembly>
</assemblyBinding>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

(In my local envitonment, I looked to work Studio self and our plugin without above settings.)

  • Hi ,

    Can you please tell me how do you reference your external dependencies?

    If you are using them from Nuget, and also Sudio uses the same library is good practice to use the reference from Studio installing folder instead of NuGet.

    Can you please also try to rebuild the plugin against CU8 and see if that issue still occurs?

    We are not able to remove the assembly binding from the SDLTradosStudio.exe.config file.

    Kind regards,

    Andrea Ghisa

  • Hi  Andrea Ghisa,

    Can you please tell me how do you reference your external dependencies?

    If you are using them from Nuget, and also Sudio uses the same library is good practice to use the reference from Studio installing folder instead of NuGet.

    Can you please also try to rebuild the plugin against CU8 and see if that issue still occurs?

    Yes, we are using from Nuget.

    But it seems they are not used by Studio, there are not the same library in the Studio installing folder.

    So, this issue still continue after rebuilding against CU8.

    We use "Microsoft.Extensions.Http 5.0.0", and which depends on "Microsoft.Extensions.DependencyInjection" and "Microsoft.Extensions.Primitives".

    Now, I investigate the combinations of versions. Finally I found the combination which works our plugin (pattern 5.).

    Here is the detailed result:

    .Table showing different pattern numbers with corresponding Nuget versions of Microsoft.Extensions.Http and Microsoft.Extensions.Primitives. Results column shows compatibility with Trados Studio 2021 CU4 and CU8, with 'OK' and 'NG' indicating success or failure.

    But the combination which works for CU8 cannot work for CU4, and vice versa.

    It makes us not good because we must offer 2 types of our plugin, under CU4 and over CU8 for the same Studio 2021.

    (And the SDL Store cannot regist 2 types plugins for the same Studio 2021.)

    I hope to resolve it.

    Best regards.



    Generated Image Alt-Text
    [edited by: Trados AI at 1:28 PM (GMT 0) on 5 Mar 2024]
  • Hi ,

    have you tried making specific reference to your version of the assemblies from the plugin manifest?

    Example:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <?xml version="1.0" encoding="utf-8"?>
    <PluginPackage xmlns="http://www.sdl.com/Plugins/PluginPackage/1.0">
    <PlugInName>My FileType</PlugInName>
    <Version>1.0.0.0</Version>
    <Description>My FileType</Description>
    <Author>Author</Author>
    <RequiredProduct name="SDLTradosStudio" minversion="16.0"/>
    <Include>
    <File>Microsoft.Extensions.DependencyInjection.dll</File>
    <File>Microsoft.Extensions.Primitives.dll</File>
    etc..
    etc..
    </Include>
    </PluginPackage>
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Patrick Andrew Hartnett | Developer Experience | Team Lead | RWS Group

  • Hi ,

    Thank you for your advice.

    have you tried making specific reference to your version of the assemblies from the plugin manifest?

    Yes, I have already added <File> tag to pluginpackage.manifest.xml, but my issue is still cotinuing...

    Thanks.

  • Hi ,

    "It makes us not good because we must offer 2 types of our plugin, under CU4 and over CU8 for the same Studio 2021.

    (And the SDL Store cannot regist 2 types plugins for the same Studio 2021.)"

    It is possible to release 2 plugins for Trados 2021. We also have released different plugins which are targetting different CUs for SDL Machine Translation Cloud.

    Dropdown menu for selecting a version of Trados Studio with options including 1.9.11.0 (2015), 3.2.10.1 (2019 SR2 and above), 2.1.2.0 (2017 SR1 CU18 and above), 4.2.11.1 (2021 up to CU6), and 4.2.12.1 (2021 CU7+).

    Maybe can explain how you can add them on the OOS and what convention needs to be followed.

    Kind regards,

    Andrea Ghisa



    Generated Image Alt-Text
    [edited by: Trados AI at 1:28 PM (GMT 0) on 5 Mar 2024]
  • Hello ,

    To add separate versions of the plugin - simply go to your account and Apps.

    Select the app- and then 'Add New Version'

    SDL Account webpage showing Products & Plans, Apps & Developers, Support & Education, and Account tabs. Highlighted is the 'Add New Version' button for the MT Enhanced Plugin for Trados Studio.

    Please refer to the following Wiki for more information.

    community.sdl.com/.../03-plugin-manifest-file-convention

     

    Oana Nagy | Developer Experience | QA Engineer | RWS Group



    Generated Image Alt-Text
    [edited by: Trados AI at 1:28 PM (GMT 0) on 5 Mar 2024]
  • Hi  Andrea Ghisa and Steven Whale,

    Thank you for your guidance, we succeeded to release 2 plugins for Trados 2021.

    We are so happy because we don't have to force update CU8 for our customers.

    Thank you again for your cooperations.

    Best regards.

  • Hi ,

    I'm glad everything is working now.

    Have a nice week,

    Andrea Ghisa