I am using the Microsoft.Graph library and I am getting this exception upon sending an email. The full exception is:
System.TypeInitializationException: The type initializer for 'Azure.Core.ClientOptions' threw an exception.
---> System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.1, 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 Azure.Core.ClientOptions..ctor(ClientOptions clientOptions, DiagnosticsOptions diagnostics)
at Azure.Core.DefaultClientOptions..ctor()
at Azure.Core.ClientOptions..cctor()
--- End of inner exception stack trace ---
at Azure.Identity.TokenCredentialOptions..ctor()
at Shelby.Core.Communication.MsGraphEmailService.d__6.MoveNext()
I have tried adding a binding redirect but all I got was another error saying that System.Memory was not found at all. I don't know what else to try. Do I:
- Install
System.Memoryto the same lib that hasMicrosoft.Graph? - Remove the binding redirect and do option 1?
Either way, the only versions of System.Memory I can find on nuget right now are: 4.5.5, 4.5.4, 4.5.3, 4.5.2, 4.5.1, and 4.5.0. What else can I do?