diff --git a/module/PowerShellEditorServices/PowerShellEditorServices.psd1 b/module/PowerShellEditorServices/PowerShellEditorServices.psd1 index 889a78cc5..1899fdf81 100644 --- a/module/PowerShellEditorServices/PowerShellEditorServices.psd1 +++ b/module/PowerShellEditorServices/PowerShellEditorServices.psd1 @@ -49,7 +49,7 @@ PowerShellVersion = '5.1' # Minimum version of Microsoft .NET Framework required by this module # NOTE: We check this later, so that the error message is communicated properly to the user -# DotNetFrameworkVersion = '4.6.1' +# DotNetFrameworkVersion = '4.6.2' # Minimum version of the common language runtime (CLR) required by this module # CLRVersion = '' @@ -129,4 +129,3 @@ PrivateData = @{ # DefaultCommandPrefix = '' } - diff --git a/src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs b/src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs index 06bc9acf4..bc2130076 100644 --- a/src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs +++ b/src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs @@ -32,7 +32,8 @@ namespace Microsoft.PowerShell.EditorServices.Hosting public sealed class EditorServicesLoader : IDisposable { #if !CoreCLR - private const int Net461Version = 394254; + // See https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed + private const int Net462Version = 394802; private static readonly string s_psesBaseDirPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); #endif @@ -242,7 +243,7 @@ private static void LoadEditorServices() => #if !CoreCLR private void CheckNetFxVersion() { - _logger.Log(PsesLogLevel.Diagnostic, "Checking that .NET Framework version is at least 4.6.1"); + _logger.Log(PsesLogLevel.Diagnostic, "Checking that .NET Framework version is at least 4.6.2"); using RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"); object netFxValue = key?.GetValue("Release"); if (netFxValue == null || netFxValue is not int netFxVersion) @@ -252,9 +253,9 @@ private void CheckNetFxVersion() _logger.Log(PsesLogLevel.Verbose, $".NET registry version: {netFxVersion}"); - if (netFxVersion < Net461Version) + if (netFxVersion < Net462Version) { - _logger.Log(PsesLogLevel.Warning, $".NET Framework version {netFxVersion} lower than .NET 4.6.1. This runtime is not supported and you may experience errors. Please update your .NET runtime version."); + _logger.Log(PsesLogLevel.Warning, $".NET Framework version {netFxVersion} lower than .NET 4.6.2. This runtime is not supported and you may experience errors. Please update your .NET runtime version."); } } #endif