HTTP 500 and "Could not load file or assembly" errors may occur after upgrading a beacon to version 2020 R2.2 (16.2) due to web.config file not being updated

HTTP 500 and "Could not load file or assembly" errors may occur after upgrading a beacon to version 2020 R2.2 (16.2) due to web.config file not being updated

Symptoms

After upgrading a FlexNet Manager Suite beacon to the 2020 R2.2 (16.2) release, agent logging may show HTTP 500 "internal server error" failures when attempting to upload and download data from the beacon.
 
For example:
[08/03/2021 10:38:58 (N, 0)] {4108} Downloading “http://beacon/ManageSoftDL/Policies/Merged/_domain/Machine/hostname.npl?machinename=hostname&ipaddress=10.23.45.67” to “C:\Windows\TEMP\NDL29503.npl”
[08/03/2021 10:38:58 (G, 0)] {4108} Download failure: Error 0xE05001F4: 500 Internal Server Error
[08/03/2021 10:38:58 (U, 0)] {4108} ERROR: Error (s107m857)
[08/03/2021 10:38:58 (U, 0)] {4108} ----------------
[08/03/2021 10:38:58 (U, 0)] {4108} The web server or proxy from which ManageSoft is attempting to retrieve the application returned the following HTTP error message:

Error 0xE05001F4: 500 Internal Server Error

Contact your network administrator or the
originating site's Webmaster for assistance.

[08/03/2021 10:38:58 (N, 0)] {4108} Download FAILED for “http://beacon/ManageSoftDL/Policies/Merged/_domain/Machine/hostname.npl?machinename=hostname&ipaddress=10.23.45.67”
 

Diagnosis

To further qualify this problem, logon to the beacon and browse to http://localhost/ManageSoftDL. A beacon affected by this problem will display a page reporting an error like either of the following:

Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.

For example:

JSON Error.png

The Application event log on the beacon will also show errors like the following:

Process information: 
Process ID: 5428
Process name: w3wp.exe
Account name: IIS APPPOOL\Flexera Beacon

Exception information:
Exception type: HttpException
Exception message: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter..ctor()
at System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()
at System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters()
at System.Web.Http.HttpConfiguration.DefaultFormatters(HttpConfiguration config)
at System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection routes)
at System.Web.Http.GlobalConfiguration.<CreateConfiguration>b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at System.Web.Http.GlobalConfiguration.get_Configuration()
at Flexera.Beacon.IISWeb.Global.Application_Start(Object sender, EventArgs e)

Cause

This problem occurs because the beacon upgrade process may not merge new assembly bindings into the beacon's web.config file.

Solution

Modify the C:\Program Files (x86)\Flexera Software\Inventory Beacon\DotNet\Web.config file on the beacon and replace the lines within the <assemblyBinding> element with the following:

<dependentAssembly>
  <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
  <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
  <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Web.Http" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
  <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral"/>
  <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>

After editing this file, restart Microsoft Internet Information Services (IIS) and the Beacon Engine Windows service.

Was this article helpful? Yes No
No ratings
Version history
Revision #:
4 of 4
Last update:
‎Aug 16, 2021 01:28 AM
Updated by:
 
Contributors