playwright-dotnet icon indicating copy to clipboard operation
playwright-dotnet copied to clipboard

System.Memory binding redirect needed following update to 1.29

Open BasketGolfer opened this issue 4 years ago • 3 comments

Similar to issue #2055 See that issue for the specific environment details After upgrading the nuget package to 1.29 got: Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Note I worked around by adding a binding redirect <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.5" newVersion="6.0.0.5" /> </dependentAssembly> </assemblyBinding> Therefore this issue is "solved" until it likely happens again with the next upgrade. Posting this incase someone else runs into this - like me for example :)

BasketGolfer avatar Nov 23 '22 15:11 BasketGolfer

Which .NET version aka. TFM are you using? So I can reproduce it locally.

mxschmitt avatar Nov 30 '22 16:11 mxschmitt

Hi, sorry for the delay! I worked around this the same way I worked around issue https://github.com/microsoft/playwright-dotnet/issues/2055 -binding redirect (adding System.Memory), the below is what I am currently using.

I have a note that System.Text.Json is likely to be problematic following a Playwright update and needs binding redirects for it and every assembly it references.

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.5" newVersion="6.0.0.5" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

BasketGolfer avatar Dec 01 '22 11:12 BasketGolfer

Looks stale and resolved with the workaround above, closing by that. For further issues please file a new issue.

mxschmitt avatar Mar 02 '23 20:03 mxschmitt