Reputation: 549
We use IHttpClientFactory in a .NET 4.7 COM+ class. To be able to use IHttpClientFactory, we added the Nuget package Microsoft.Extensions.Http version 7.0, which installed the following dlls in the packages directory:
Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
Microsoft.Extensions.DependencyInjection.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll
Microsoft.Extensions.DependencyInjection.7.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.dll
Microsoft.Extensions.Http.7.0.0\lib\net462\Microsoft.Extensions.Http.dll
Microsoft.Extensions.Logging.7.0.0\lib\net462\Microsoft.Extensions.Logging.dll
Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll
Microsoft.Extensions.Options.7.0.0\lib\net462\Microsoft.Extensions.Options.dll
Microsoft.Extensions.Primitives.7.0.0\lib\net462\Microsoft.Extensions.Primitives.dll
System.Buffers.4.5.1\lib\net461\System.Buffers.dll
System.Diagnostics.DiagnosticSource.7.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll
System.Memory.4.5.5\lib\net461\System.Memory.dll
System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
We installed these dlls in the GAC with gacutil. Upon calling the method HttpClient.PostAsync we get the exception:
Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Best regards,
Alexandros
Upvotes: 0
Views: 57