4

One of our customers did integrate the one trust cookie policy plugin in the DXA 2.2.9 .NET Webapp in Tridion Sites 9.5, one trust plugin placing a date value cookie that breaks the DXA website.

Error Message:

System.InvalidCastException: Unable to cast object of type System.Collection.Generic.Dictionary2[System.String.System.Object] to type

Investigated and found that in DXA Framework below method line breaks due to CIL Library ADF - Claims Deserialize for a cookie date value.

Sdl.Web.Mvc.Configuration.WebRequestContext.IsSessionPreview
var cookies = claimStore?.Get<Dictionary<string, string>>(new Uri(WebClaims.REQUEST_COOKIES));

1 Answer 1

6

The problem was that DXA is using an older version of the CIL out the box. Updating the references to the later versions available on nuget.org resolves the problem.

The following steps fixed this issue.

  1. Upgrade the Sdl.Web.Delivery version to 11.1.1103 from NuGet.
  2. Updated the DXA Webapp web.config to resolve all the conflicts
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Core" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Caching" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="8.1.0.1239-10.1.0.1003" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Broker" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="8.1.0.1239-10.1.0.1003" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.DiscoveryService" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Dynamic" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="8.1.0.1239-10.1.0.1003" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Linking" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="8.1.0.1239-10.1.0.1003" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Model" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="8.1.0.1239-10.1.0.1003" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.Service" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Sdl.Web.Delivery.ServicesCore" publicKeyToken="ddfc895746e5ee6b" culture="neutral"/>
        <bindingRedirect oldVersion="8.1.0.1239-10.1.0.1003" newVersion="11.1.0.0"/>
      </dependentAssembly>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.