Skip to content

PowerShell 7.6 and NET 10 Support #235

@ddemeyer

Description

@ddemeyer

Inspired by https://devblogs.microsoft.com/powershell/announcing-powershell-7-6/

Problem...
However, this time it is a must as running ISHRemote v8.1, which is compiled for cross-platform .NET 6.0 (and Windows .NET Framework 4.8) fails to load in PowerShell 7.6 LTS which is powered by .NET 10 LTS. You'll see errors like

  • New-IshSession fails with Could not load type 'System.IdentityModel.Tokens.SecurityKeyType' from assembly 'System.ServiceModel.Security, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
  • Pester test harness shows error like
    • ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
    • ParameterBindingValidationException: Cannot validate argument on parameter 'IshSession'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

Microsoft .NET 10.0 broke compatibility compared to .NET 8.0.

Actions...

  • Switch from .NET Standard 2.0, so covering NET48 and NET6, System.ServiceModel version to explicit NET10 version in Trisoft.ISHRemote.csproj
  • System.IdentityModel.Tokens.SecurityKeyType is no longer an enum but became a string; so BearerKey needs to become http://schemas.microsoft.com/idfx/keytype/bearer
  • Still deliver NET 6 code base, but make sure that the dynamic loading in ISHRemote.psm1 is correct for PowerShell 7.6
  • Verify all NET 10 code, especially the Windows Communication Foundation (WCF) Soap code
  • CI/CD, so /.github/workflows/continuous-integration.yml, currently holds PowerShell Update - 7.2.13/lts has issues, updating to latest stable (like 7.3.6 or higher) which installed 7.6 and broke all test pipelines.
  • Update readme.md installation routines steps to go beyond PS72/NET6 and PS74/NET8 to PS76/NET10. And as Microsoft no longer supports older PS72 and PS74, ISHRemote should mark these as deprecated and probably also not tested because there is no CI/CD available for it on Github.

Optional...
What can we do about pushing all PackageReferences for .NET 10 or all only to latest

  • Microsoft.PowerShell.Commands.Management from 7.2.24 to 7.6.0 for NET10
  • Duende.IdentityModel from 7.1.0 to 8.1.0 for NET10
  • Duende.IdentityModel.OidcClient from 6.0.1 to 7.1.0 for NET10
  • System.Text.Json from 8.0.6 to 10.0.5 for NET10
  • System.Drawing.Common from 8.0.8 to 10.0.5 for NET10
  • System.Numerics.Vectors from 4.5.0 to 4.6.1 for NET10
  • System.Text.Encodings.Web from 8.0.0 to 10.0.5 for NET10
  • System.ServiceModel.* from 8.0.0 to 10.0.652802 for NET10

What can we do about warnings...

  • CertificateValidationHelper.cs(72,32,72,51): warning SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.
  • IshSession.cs(139,13,139,32): warning SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.'
  • InfoShareWcfSoapBearerCredentials.cs(92,20,92,94): warning SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions