runtime: CurlHandler fails to initialize if have only shared runtime rather than full SDK

From @JohnRusk on May 4, 2017 5:27

Steps to reproduce

I run my app, which uses WindowsAzure.Storage (version 8.0.0) and targets .NET Core 1.1.1. I get this exception:

System.TypeInitializationException: The type initializer for 'System.Net.Http.CurlHandler' threw an exception. ---> 
System.TypeInitializationException: The type initializer for 'Http' threw an exception. ---> 
System.TypeInitializationException: The type initializer for 'HttpInitializer' threw an exception. ---> 
System.DllNotFoundException: Unable to load DLL 'System.Net.Http.Native': The specified module could not be found.
 (Exception from HRESULT: 0x8007007E)
   at Interop.HttpInitializer.EnsureCurlIsInitialized()
   at Interop.HttpInitializer..cctor()
   --- End of inner exception stack trace ---
   at Interop.Http..cctor()
   --- End of inner exception stack trace ---
   at Interop.Http.GetSupportedFeatures()
   at System.Net.Http.CurlHandler..cctor()
   --- End of inner exception stack trace ---
   at System.Net.Http.CurlHandler..ctor()
   at Microsoft.WindowsAzure.Storage.Auth.Protocol.StorageAuthenticationHttpHandler.<>c.<.cctor>b__8_0()

Expected behavior

It should work, regardless of whether I have the full SDK or just the shared runtime.

Actual behavior

I get the above error if I just have the shared runtime. It works if I have the full SDK.

Environment data

Fails if shared runtime only. Works if SDK is present. Testing on Ubuntu 16.04

Note:

For reference, a variant of this issue appears here: http://stackoverflow.com/questions/42472536/can-a-library-that-depends-on-system-net-http-winhttphandler-be-deployed-to-linu

Copied from original issue: dotnet/cli#6513

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

From this exception text Unable to load DLL 'System.Net.Http.Native' it looks like the right binaries are not present in the app. @JohnRusk can you please provide a repro? (ideally minimal one)