Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS Core 6.0 Beta3 doesn't load in v1.4.0 #529

Closed
rkeithhill opened this issue Jun 22, 2017 · 6 comments · Fixed by #530
Closed

PS Core 6.0 Beta3 doesn't load in v1.4.0 #529

rkeithhill opened this issue Jun 22, 2017 · 6 comments · Fixed by #530
Milestone

Comments

@rkeithhill
Copy link
Contributor

rkeithhill commented Jun 22, 2017

Just installed PS Core Beta 3 on Windows 10 CU. Fire up VSCode 1.13.0 with 1.4.0 of the PS extension, switched to PS Core 6.0 Beta 3 and got this error:

PowerShell Integrated Console



An error occurred while starting PowerShell Editor Services:

Exception calling "StartLanguageService" with "2" argument(s): "Could not load file or assembly 'Microsoft.Po
werShell.EditorServices.Protocol, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file
specified."
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception excep
tion)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)

   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
   at System.Management.Automation.CommandProcessorBase.Complete()
Could not load file or assembly 'Microsoft.PowerShell.EditorServices.Protocol, Version=1.4.0.0, Culture=neutral, PublicKey
Token=null'. The system cannot find the file specified.
   at Microsoft.PowerShell.EditorServices.Host.EditorServicesHost.StartLanguageService(Int32 languageServicePort, ProfileP
aths profilePaths)
   at CallSite.Target(Closure , CallSite , Object , Object , Object )
@daviwil
Copy link
Contributor

daviwil commented Jun 22, 2017

You're fast ;) Luckily the team caught that for me this morning and I'll be shipping an update with a fix in an hour or so.

@rkeithhill
Copy link
Contributor Author

Is it something about -FeatureFlags not getting the expected empty string array arg?

@daviwil
Copy link
Contributor

daviwil commented Jun 22, 2017

Nah, it's that I'm not explicitly loading the Protocol DLL using Add-Type and the change they made to the AssemblyLoadContext isn't auto-loading it anymore. It's a simple fix thankfully

@rkeithhill
Copy link
Contributor Author

Ah, so the issue I see trying to run the command from the PowerShell console is just a red herring then. OK. I'll await the fix. :-)

@daviwil
Copy link
Contributor

daviwil commented Jun 22, 2017

If you want a quick fix for now you can just edit PowerShellEditorServices.psm1 to add the Add-Type line for Protocol

@rkeithhill
Copy link
Contributor Author

FWIW I thought it was maybe related to the breaking change in powershell.exe positional parameters ie. position 0 is now -File instead of -Command.

RE the fix, I can wait.

@daviwil daviwil modified the milestone: 1.4.1 Jun 22, 2017
daviwil added a commit to daviwil/PowerShellEditorServices that referenced this issue Jun 22, 2017
This change fixes an issue caused by PowerShell Core 6.0.0-beta3's
AssemblyLoadContext changes where the Protocol assembly isn't being
auto-loaded when the Host assembly gets loaded.  The fix is to
explicitly load that assembly when loaded inside of PowerShell Core.

Resolves PowerShell#529
daviwil added a commit that referenced this issue Jun 22, 2017
This change fixes an issue caused by PowerShell Core 6.0.0-beta3's
AssemblyLoadContext changes where the Protocol assembly isn't being
auto-loaded when the Host assembly gets loaded.  The fix is to
explicitly load that assembly when loaded inside of PowerShell Core.

Resolves #529
@daviwil daviwil modified the milestones: 1.4.1, 1.5.0 Oct 27, 2017
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this issue Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants