You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a regression introduced by .NET Core 1.1 preview release libraries. It also happens on alpha.12 release.
Steps to reproduce
$RequiredAssembliesForInternalWebProxy=@( [System.Net.IWebProxy].Assembly.FullName,
[System.Uri].Assembly.FullName )
$SourceForInternalWebProxy=@"using System; using System.Net;namespace Microsoft.PowerShell.Commands.PowerShellGet { /// <summary> /// Used by Ping-Endpoint function to supply webproxy to HttpClient /// We cannot use System.Net.WebProxy because this is not available on CoreClr /// </summary> public class InternalWebProxy : IWebProxy { Uri _proxyUri; ICredentials _credentials; public InternalWebProxy(Uri uri, ICredentials credentials) { Credentials = credentials; _proxyUri = uri; } /// <summary> /// Credentials used by WebProxy /// </summary> public ICredentials Credentials { get { return _credentials; } set { _credentials = value; } } public Uri GetProxy(Uri destination) { return _proxyUri; } public bool IsBypassed(Uri host) { return false; } }} "@Add-Type-ReferencedAssemblies $RequiredAssembliesForInternalWebProxy`-TypeDefinition $SourceForInternalWebProxy`-Language CSharp `-ErrorAction SilentlyContinue
Expected behavior
Succeeds
Actual behavior
Add-Type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more
information.
At line:1 char:1+Add-Type-ReferencedAssemblies $RequiredAssembliesForInternalWebProxy ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
+ FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
PS D:\>
PS D:\>$Error[0].Exception.LoaderExceptions
Method 'GetProxy'in type 'Microsoft.PowerShell.Commands.PowerShellGet.InternalWebProxy'from assembly 'nxg304ea.wnz,Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
This is a regression introduced by .NET Core 1.1 preview release libraries. It also happens on
alpha.12release.Steps to reproduce
Expected behavior
Succeeds
Actual behavior
Environment data