2 Replies Latest reply on Sep 26, 2016 9:04 PM by David La Motta

    Cannot find type [System.Net.HttpListener]

    David La Motta Newbie

      Hi folks-

       

      I am playing around with PowerShell on RHEL 7.2 and I wanted to spin up a quick HttpLister. Alas, I am getting an error indicating the library cannot be found.

       

      New-Object : Cannot find type [System.Net.HttpListener]: verify that the assembly containing this type is loaded.

      At line:1 char:14

      +  $listener = New-Object System.Net.HttpListener

      +              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException

          + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

       

      System.Net.HttpLister is part of .NET Core 1.0. I've installed dotnet in my system and did the 'scl enable' in my shell.

       

      What am I missing?

       

      Thanks for any help.

       

      // David