Vscode-powershell: Unable to Load Terminal

Created on 3 Jun 2021  路  14Comments  路  Source: PowerShell/vscode-powershell

Issue Type: Bug

After recent update to 2021.5.1, the terminal fails to load with below error on Windows Server 2016 with WMF 5.1

image

Extension version: 2021.5.1
VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:13:13.157Z)
OS version: Windows_NT x64 10.0.14393

Area-Startup Issue-Bug Needs PowerShell 5.1

All 14 comments

What version of PowerShell are you using? @rjmholt we should take a look at this.

Name                           Value
----                           -----
PSVersion                      5.1.14393.4402
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.4402
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Interesting...can you tell me if it repros with PowerShell 7? Just to help narrow down the cause.

Also, could you please provide your logs by following these steps?

I am not able to install PowerShell 7 on this server - it is an Azure Automation hybrid worker and only works with PS 5.1.

1622738848-33b3fe3f-9d15-4d9e-95f6-08cd39cb8ff81622738843439.zip

That is helpful, thanks!

@rjmholt curiously I see this:

Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Why on earth is netstandard trying to be loaded for PowerShell 5.1? This https://github.com/PowerShell/PowerShellEditorServices/pull/1426 is the only related change I can think of, but it doesn't appear like it'd cause this.

Could this have something to do with it @rjmholt:

2 The versions listed here represent the rules that NuGet uses to determine whether a given .NET Standard library is applicable. While NuGet considers .NET Framework 4.6.1 as supporting .NET Standard 1.5 through 2.0, there are several issues with consuming .NET Standard libraries that were built for those versions from .NET Framework 4.6.1 projects. For .NET Framework projects that need to use such libraries, we recommend that you upgrade the project to target .NET Framework 4.7.2 or higher.

From https://docs.microsoft.com/en-us/dotnet/standard/net-standard

Well, that's a bug. @rjmholt I can confirm that netstandard.dll is not contained in PowerShell-2021.5.1, but I have no idea why:

$ find PowerShell-2021.2.2 -name netstandard.dll
PowerShell-2021.2.2/extension/modules/PowerShellEditorServices/bin/Desktop/netstandard.dll
@JEWANG3 ~/Downloads 
$ find PowerShell-2021.5.1 -name netstandard.dll
@JEWANG3 ~/Downloads 
$ 
$ ls PowerShell-2021.5.1/extension/modules/PowerShellEditorServices/bin/Desktop/
Microsoft.PowerShell.EditorServices.Hosting.dll  System.Runtime.InteropServices.RuntimeInformation.dll
Microsoft.PowerShell.EditorServices.Hosting.pdb  System.ValueTuple.dll

Ok so I can reproduce this in the build and have a good commit at v2.3.0, and a bad commit at v2.4.0-preview.1, but only if I delete the whole .dotnet folder and run our SetupDotnet task (in addition to cleaning and building). In former, we were only installing up to .NET SDK 5.0, in the latter we now install .NET SDK 6.0 (to support PowerShell 7.2). The behavior of dotnet publish appears to have changed because with the former version, netstandard.dll is included upon publishing, and with the latter it is not.

Hello! @CATgwalker can you unzip this attached zip file and use "Extensions: Install from VSIX..." to test this in your environment? I think it should fix the problem.

PowerShell-insiders.vsix.zip

Thanks! Apologies for the delay.

Unfortunately I receive a different error now. See attached logs.
1622836655-7c736c18-4425-4e95-bca5-8721574ee9501622836574157.zip

Ah, ok, no problem. I need to copy all the stuff out of bin and not just that one folder. We did figure out the problem upstream, I'm just figuring out a workaround until it's fixed properly.

Ok, one more insiders build to test if you would please:
PowerShell-insiders.vsix.zip

Thanks! Terminal is loading correctly now with that build.

Perfect, thanks for the info! This will get fixed in the next preview release (or maybe I'll just drop it straight into a stable release, we'll see).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GQnzo picture GQnzo  路  3Comments

TheDanishDynamo picture TheDanishDynamo  路  3Comments

guidooliveira picture guidooliveira  路  3Comments

bgelens picture bgelens  路  3Comments

rkeithhill picture rkeithhill  路  3Comments