Powerslave
Powerslave

Reputation: 457

K4os.Compression.LZ4: Could not load file or assembly 'System.Memory, Version=4.0.1.2, ...'

I'm at a loss.

I am on .NET Framework 4.8.

I installed K4os.Compression.LZ4 1.3.8 via Nuget and use LZ4Pickler.Pickle().

My required dependencies according to https://www.nuget.org/packages/K4os.Compression.LZ4/ are as follows:

When the above code is executed, I get the following error message:

System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, 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)
File name: 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
 at AstrumIT.Argos.Web.ViewState.Lz4Serializer.Serialize(Object value)
 at AstrumIT.Argos.Web.ViewState.DatabaseViewStatePersistence.Serialize(Object value, String view, Option`1 url, Option`1 loginUserInternalName) in C:\_Work\Repositories\Argos\Dev\Projects\AstrumIT.Argos.Web\ViewState\IViewStatePersistence.cs:line 316
 at AstrumIT.Argos.Web.ViewState.ViewStatePersistenceService.Serialize(Object value, String view, Option`1 url, Option`1 loginUserInternalName) in C:\_Work\Repositories\Argos\Dev\Projects\AstrumIT.Argos.Web\ViewState\IViewStatePersistence.cs:line 101
 at AstrumIT.Argos.WebInterface.Pages.ArgosPage.SavePageStateToPersistenceMedium(Object viewState) in C:\_Work\Repositories\Argos\Dev\Projects\WebInterface\Pages\ArgosPage.cs:line 179
 at System.Web.UI.Page.SaveAllState()
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

=== Pre-bind state information ===
LOG: DisplayName = System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
 (fully specified)
LOG: Appbase = file:///C:/_Work/Repositories/Argos/Dev/Projects/WebInterface/
LOG: Initial PrivatePath = C:\_Work\Repositories\Argos\Dev\Projects\WebInterface\bin
Calling assembly : K4os.Compression.LZ4, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\_Work\Repositories\Argos\Dev\Projects\WebInterface\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: Post-policy reference: System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/visit/20f33543/6dc9610/System.Memory.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/visit/20f33543/6dc9610/System.Memory/System.Memory.DLL.
LOG: Attempting download of new URL file:///C:/_Work/Repositories/Argos/Dev/Projects/WebInterface/bin/System.Memory.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

There is no assembly binding defined in app.config.

I also tried the following bindingRedirect, but the error don't change:

<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>

I also tried the following bindingRedirect, then the following error occurs:

<dependentAssembly>
    <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.6.0.0" newVersion="4.6.0.0" />
</dependentAssembly>

#########################################################

 Could not load file or assembly 'System.Memory' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System.Memory' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Memory' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = System.Memory
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: System.Memory | Domain ID: 15
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:/_Work/Repositories/Argos/Dev/Projects/WebInterface/
LOG: Initial PrivatePath = C:\_Work\Repositories\Argos\Dev\Projects\WebInterface\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\_Work\Repositories\Argos\Dev\Projects\WebInterface\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/visit/20f33543/6dc9610/System.Memory.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/visit/20f33543/6dc9610/System.Memory/System.Memory.DLL.
LOG: Attempting download of new URL file:///C:/_Work/Repositories/Argos/Dev/Projects/WebInterface/bin/System.Memory.DLL.
LOG: Using application configuration file: C:\_Work\Repositories\Argos\Dev\Projects\WebInterface\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.6.0.0.
LOG: Post-policy reference: System.Memory, Version=4.6.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/visit/20f33543/6dc9610/System.Memory.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/visit/20f33543/6dc9610/System.Memory/System.Memory.DLL.
LOG: Attempting download of new URL file:///C:/_Work/Repositories/Argos/Dev/Projects/WebInterface/bin/System.Memory.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Why is it trying to load 4.0.1.2 when >= 4.5.5 is required?

I really have no idea how to solve this. Please help!

Thank you in advance.

Upvotes: 1

Views: 106

Answers (0)

Related Questions