PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

2.0.0 preview Module loading error (pb loading netstandard, Version=2.0.0.0)

Open XPlantefeve opened this issue 6 years ago • 3 comments

Description

When trying to launch the PowerShell preview 2.0.0 in VSCode, I've got an error that I was able to pin down to the importation of the PowerShellEditorServices module. When trying to load the module by itself, there is three Add-Type errors. When trying those Add-Type manually, I've got the same errors that say Unable to load one or more of the requested types. I checked the LoaderException objects, and it seems to boil down to that message:

{System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Files attached

EditorServices-reportlogs.zip contains:

  • vscode-powershell.log
  • Start-EditorServices-EditorServices.log (log level: diagnostic)
  • Import-Module.log (manual module importation, verbose)
  • LoaderException.txt (random loader exception among loads of identical ones)

XPlantefeve avatar Jan 24 '19 11:01 XPlantefeve

@XPlantefeve what version of the .NET Framework do you have installed on your machine?

TylerLeonhardt avatar Jan 24 '19 15:01 TylerLeonhardt

It's 4.7.02046 apparently. Taken from my registry:

PSChildName                      Version        Release
-----------                      -------        -------
v2.0.50727                       2.0.50727.4927
v3.0                             3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation  3.0.6920.4902
v3.5                             3.5.30729.4926
Client                           4.0.0.0
Client                           4.7.02046      460798
Full                             4.7.02046      460798

XPlantefeve avatar Jan 24 '19 15:01 XPlantefeve

I believe only .Net 4.7.2 includes netstandard.dll, so PSES will need to distribute that assembly and conditionally require it if it's Windows PowerShell

SteveL-MSFT avatar Jan 24 '19 17:01 SteveL-MSFT