.Net Framework 4.8 is my target platform (WinForms).
I created a .Net Framework 4.8 unit test project, to isolate the code.
C# project. VS 2019 Pro, latest (as of 2/26/21).
Azure subscription. Created a storage account.
Test project has auto generate binding redirects enabled. I tried disabling it and creating specific binding redirects. Didn't help.
Code to allocate a BlobContainerClient works. Properties of this object are populated.
using (var stream = new MemoryStream(byteArray))
client.UploadBlob("test blob", stream);
fails. byteArray is allocated and filled.
System.IO.FileLoadException: 'Could not load file or assembly 'System.Buffers, Version=220.127.116.11, 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)'
Excluded any other code from the unit test project that could be causing a conflict.
If Azure.Storage.Blobs needs this version of System.Buffers, shouldn't ASB include this reference automatically?
Trying to add this System.Buffers reference via NuGet doesn't work. There is no publicly available version 4.0.2 of this package. Earlier or later packages don't work.
How to get this code to work?