System.Memory Error #522

Open
opened 2026-01-29 22:13:17 +00:00 by claunia · 2 comments
Owner

Originally created by @therealdjinn on GitHub (Jun 6, 2022).

Upgraded to 0.31 and I am getting reference errors. VS 2022 with .net 4.7.2. Downloaded from NuGet and VS references says 4.1.1. Was working with no issues.

Location: ..\packages\System.Memory.4.5.4\lib\net461

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) at SharpCompress.Archives.GZip.GZipArchive.IsGZipFile(Stream stream)
at SharpCompress.Archives.ArchiveFactory.Open(FileInfo fileInfo, ReaderOptions options)

Originally created by @therealdjinn on GitHub (Jun 6, 2022). Upgraded to 0.31 and I am getting reference errors. VS 2022 with .net 4.7.2. Downloaded from NuGet and VS references says 4.1.1. Was working with no issues. Location: ..\packages\System.Memory.4.5.4\lib\net461 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) at SharpCompress.Archives.GZip.GZipArchive.IsGZipFile(Stream stream) at SharpCompress.Archives.ArchiveFactory.Open(FileInfo fileInfo, ReaderOptions options)
Author
Owner

@therealdjinn commented on GitHub (Jun 7, 2022):

Code analysis shows possible MySQL Conflict?

Severity Code Description Project File Line Suppression State
Warning Found conflicts between different versions of "System.Memory" that could not be resolved.
There was a conflict between "System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
"System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.
References which depend on "System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\Administrator\source\repos\ImageProcessor\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll].
C:\Users\Administrator\source\repos\ImageProcessor\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
Project file item includes which caused reference "C:\Users\Administrator\source\repos\ImageProcessor\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll".
System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL
References which depend on "System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [].
C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\MySql.Data.dll
Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\MySql.Data.dll".
MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL
C:\Users\Administrator\source\repos\ImageProcessor\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll
Project file item includes which caused reference "C:\Users\Administrator\source\repos\ImageProcessor\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll".
SharpCompress, Version=0.31.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL
C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\Google.Protobuf.dll
Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\Google.Protobuf.dll".
MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL
C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\ZstdNet.dll
Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\ZstdNet.dll".
MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL
C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.Streams.dll
Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.Streams.dll".
MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL
C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.dll
Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.dll".
MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL
C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Hash.xxHash.dll
Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Hash.xxHash.dll".
MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL ImageProcessor

@therealdjinn commented on GitHub (Jun 7, 2022): Code analysis shows possible MySQL Conflict? Severity Code Description Project File Line Suppression State Warning Found conflicts between different versions of "System.Memory" that could not be resolved. There was a conflict between "System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". "System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not. References which depend on "System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\Administrator\source\repos\ImageProcessor\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll]. C:\Users\Administrator\source\repos\ImageProcessor\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll Project file item includes which caused reference "C:\Users\Administrator\source\repos\ImageProcessor\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll". System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL References which depend on "System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" []. C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\MySql.Data.dll Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\MySql.Data.dll". MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL C:\Users\Administrator\source\repos\ImageProcessor\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll Project file item includes which caused reference "C:\Users\Administrator\source\repos\ImageProcessor\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll". SharpCompress, Version=0.31.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\Google.Protobuf.dll Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\Google.Protobuf.dll". MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\ZstdNet.dll Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\ZstdNet.dll". MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.Streams.dll Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.Streams.dll". MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.dll Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Compression.LZ4.dll". MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Hash.xxHash.dll Project file item includes which caused reference "C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2\K4os.Hash.xxHash.dll". MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL ImageProcessor
Author
Owner

@therealdjinn commented on GitHub (Jun 7, 2022):

Hopefully this helps someone else. I was able to modify the *.exe.config file to point to the older dll. (below) MySQL seems to be working still. Not sure if this is the best fix but it works.

  <dependentAssembly>
    <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.1" />
  </dependentAssembly>
@therealdjinn commented on GitHub (Jun 7, 2022): Hopefully this helps someone else. I was able to modify the *.exe.config file to point to the older dll. (below) MySQL seems to be working still. Not sure if this is the best fix but it works. <dependentAssembly> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.1" /> </dependentAssembly>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#522