I'm getting an assembly binding error with System.Buffers
when working with Sitecore 9.2. What could be causing this? With assembly binding logging enabled, it appears the issue is a binding redirect expecting assembly version 4.0.3.0
, but finding 4.0.2.0
.
Could not load file or assembly 'System.Buffers' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
=== Pre-bind state information ===
LOG: DisplayName = System.Buffers
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Buffers | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/habitat.dev.local/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\habitat.dev.local\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\a31ecb9a
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\a31ecb9a
LOG: AppName = 5a56a8f2
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\habitat.dev.local\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/a31ecb9a/5a56a8f2/System.Buffers.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/a31ecb9a/5a56a8f2/System.Buffers/System.Buffers.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/habitat.dev.local/bin/System.Buffers.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\inetpub\wwwroot\habitat.dev.local\bin\System.Buffers.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: C:\inetpub\wwwroot\habitat.dev.local\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.0.2.0 redirected to 4.0.3.0.
LOG: Post-policy reference: System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: GAC Lookup was unsuccessful.
LOG: The post-policy assembly reference requires probing again.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/a31ecb9a/5a56a8f2/System.Buffers.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/a31ecb9a/5a56a8f2/System.Buffers/System.Buffers.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/habitat.dev.local/bin/System.Buffers.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\inetpub\wwwroot\habitat.dev.local\bin\System.Buffers.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.