Skip to content

macos 10.12 missing system.net.webclient #2326

Closed
@minoseah629

Description

@minoseah629

Steps to reproduce

PS /Users/> $webclient = New-Object System.Net.Web
WebException WebRequest WebUtility WebExceptionStatus WebResponse WebHeaderCollection WebSockets
PS /Users/> $webclient = New-Object System.Net.WebClient

Expected behavior

should be able to use system.net.webclient like in windows
PS C:\Windows\system32> new-object System.Net.WebClient

AllowReadStreamBuffering : False
AllowWriteStreamBuffering : False
Encoding : System.Text.SBCSCodePageEncoding
BaseAddress :
Credentials :
UseDefaultCredentials : False
Headers : {}
QueryString : {}
ResponseHeaders :
Proxy : System.Net.WebRequest+WebProxyWrapper
CachePolicy :
IsBusy : False
Site :
Container :

Actual behavior

Received error mesage
New-Object : Cannot find type [System.Net.WebClient]: verify that the assembly
containing this type is loaded.
At line:1 char:14

  • $webclient = New-Object System.Net.WebClient
  •          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidType: (:) [New-Object], PSArgumentExcepti
      on
    • FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewOb
      jectCommand
      Environment data

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.10
CLRVersion
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-ExternalThe issue is caused by external component(s).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions