Skip to content

Exception at creating System.Net.Http.HttpClient without libcurl3 in ubuntu-16.04 #1937

@itn3000

Description

@itn3000

Steps to reproduce

  1. create minimum ubuntu-16.04 env with vagrant
  2. do https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#ubuntu-1604
  3. run powershell
  4. execute New-Object System.Net.Http.HttpClient

Expected behavior

output the following text

DefaultRequestHeaders BaseAddress Timeout  MaxResponseContentBufferSize
--------------------- ----------- -------  ----------------------------
{}                                00:01:40                   2147483647

Actual behavior

occured following exception

New-Object : Exception calling ".ctor" with "0" argument(s): "The type
initializer for 'System.Net.Http.CurlHandler' threw an exception."
At line:1 char:1
+ New-Object System.Net.Http.HttpClient
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvoca
   tionException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
   Shell.Commands.NewObjectCommand

and do not work the PowerShellGet module commands(Find-Module,Install-Module,etc)

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.9
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Finally,I resolved it by installing libcurl3 package by apt-get.
I guess it is caused by dependency of System.Net.Http.CurlHandler.

Metadata

Metadata

Assignees

Labels

Area-Maintainers-Buildspecific to affecting the buildIssue-BugIssue has been identified as a bug in the product

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions