0

When building my solution I found these warnings in my build output:

NU1605: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 5.0.0 to 4.5.3. Reference the package directly from the project to select a different version. 
 GameDbVx -> GameCommon -> SharpCompress 0.27.1 -> System.Text.Encoding.CodePages 5.0.0 -> System.Runtime.CompilerServices.Unsafe (>= 5.0.0) 
 GameDbVx -> GameCommon -> System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
...

So I updated GameCommon via nuget to use System.Runtime.CompilerServices.Unsafe version 5.0.0

while this has solved the warnings, now one of my test fails, with:

Could not load file or assembly "System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" ...
   at System.MemoryExtensions.AsSpan(String text, Int32 start, Int32 length)
   at GameDb.Storage.HistoricPresentStorage.<Filter>d__6.MoveNext() in GameDbVx\Storage\HistoricPresentStorage.cs:Line 69.
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at GameLogic.Test.MyTest.MyTest() in GameLogicVx.Test\MyTest.cs:Line 1321.

using .net framework 4.7

i cannot find any other reference to System.Runtime.CompilerServices.Unsafe besides GameCommon.

I've tried adding an app.config with:

<configuration>  
   <runtime>  
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
         <dependentAssembly>  
            <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe"  
                              publicKeyToken="b03f5f7f11d50a3a"  
                              culture="neutral" />  
            <bindingRedirect oldVersion="0.0.0.0-4.0.4.1"  
                             newVersion="4.0.4.1"/>  
         </dependentAssembly>  
      </assemblyBinding>  
   </runtime>  
</configuration> 

and tried changing the version from 4.0.4.1 to 5.0.0.0 (see: https://stackoverflow.com/a/62770487/2139679) but it had no effect at all.

for now i live with the warnings, but how would I solve them without getting the Could not load file or assembly exception

Soraphis
  • 706
  • 7
  • 26

0 Answers0