I am working with a .net kernel and must make an HTTP call on my server.
The code used is as follows:
try { var client = new HttpClient (); var helloUri = new System.Uri (string.Concat ("http://localhost:1234", "/hello")); var response = client.GetAsync (helloUri); var helloReponse = response.Result; return helloReponse.StatusCode == System.Net.HttpStatusCode.OK; } catch (System.Exception e) { throw e; }
I am creating a publishing package with the specified runtime (osx10.12-x64 in my case). When working with osx, I have this error:
(The type initializer for 'System.Net.Http.CurlHandler' threw an 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.TypeInitializationException: The type initializer for 'CryptoInitializer' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'System.Security.Cryptography.Native.OpenSsl': The specified module could not be found.
My publication folder contains "System.Security.Cryptography.Native.OpenSsl.dylib"
This link ( https://github.com/dotnet/cli/issues/5129 ) told me how to solve the problem on my machine.
How can I do this on a client machine that does not have dotnet?
Catia source share