dansiegel / Mobile.BuildTools

The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
http://mobilebuildtools.com
MIT License
228 stars 29 forks source link

Image Processing Task cannot find System.Memory #97

Closed dansiegel closed 4 years ago

dansiegel commented 4 years ago

Description

When running in the generated NuGet, the Image.Load encounters a type initialization exception with an inner exception as it cannot find System.Memory.

When evaluating the current domain's loaded assemblies in tests we see System.Memory loaded here:

System.Memory, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Memory.dll

When we evaluate the Current Domain in the Build Task we do see System.Memory loaded here:

System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\System.Memory.dll

However when we call Image.Load we see the following error message:

Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Reproduction Steps

  1. Build the Mobile.BuildTools
  2. Build the E2EApp

Expected Behavior

We should not have any exceptions

Actual Behavior

We see the error referenced above

Environment

Reproduction App

E2E App

dansiegel commented 4 years ago

fixed