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:

    <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>

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

Parents
  • 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]
Reply
  • 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]
Children