Publishing Service update crashes Sitecore instance

  • Description

    When updating Sitecore Publishing Service (SPS) the exception occurs due to the incorrect referencing to some assemblies. For example, System.Net.Http and System.Diagnostics.DiagnosticSource cannot be loaded after upgrading the SPS module to 3.1.3 version on clean Sitecore XP instance with installed .NET Framework 4.7.0 or earlier. Components use internally later versions compared to the versions available in NuGet. This versioning issue causes Sitecore instance to crash.
    The example of exceptions from logs:
    System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    ...
    Exception: Sitecore.Framework.Publishing.Client.Http.HttpServiceResponseException
    Message: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

  • There are several ways to resolve this issue:
    • Download and install .NET Framework 4.7.2 on the server that hosts the Sitecore instance.
    • Add the following assembly binding to the Sitecore web.config file:
    <dependentAssembly>
    <assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
    <bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.0.0.0" />
    </dependentAssembly>

Applies to:

Publishing Service 3.1 Update-3

June 11, 2019
June 21, 2019

Reference number:

329804