Skip to content

Installing from the command line or UI does not work #245

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

Closed
rgl opened this issue Aug 18, 2016 · 4 comments
Closed

Installing from the command line or UI does not work #245

rgl opened this issue Aug 18, 2016 · 4 comments

Comments

@rgl
Copy link

rgl commented Aug 18, 2016

I'm trying to install from the command line with:

code --install-extension ms-vscode.PowerShell

But after I start code it errors out with:

image

Even reinstalling the extension from the UI does not work.

Sorry, but I didn't find a way to troubleshoot the install (--verbose does not seems to do the trick), so you have to help me on how show I get more details.

I'm using Windows 2012 R2. Maybe I need to install something on the system before installing this extension?

@daviwil
Copy link
Contributor

daviwil commented Aug 18, 2016

Hey Rui, can you zip up the contents of the following folder and send it to me?

$HOME\.vscode\extensions\ms-vscode.PowerShell-0.7.0\logs

You can just drop the zip file into the comment box and it should upload the file to GitHub.

@rgl
Copy link
Author

rgl commented Aug 20, 2016

Here it is:

powershell.exe started --
    pid: 1184
    exe: C:\Windows\Sysnative\WindowsPowerShell\v1.0\powershell.exe
    bundledModulesPath: C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules
    args: C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start-EditorServices.ps1 -EditorServicesVersion "0.7.0" -HostName "Visual Studio Code Host" -HostProfileId "Microsoft.VSCode" -HostVersion "0.7.0" -BundledModulesPath "C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules" -LogLevel "Normal" -LogPath "C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\logs\1471678454-EditorServices.log" 

ERROR: Method invocation failed because [System.Random] does not contain a method 
named 'new'.
ERROR: At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
-EditorServices.ps1:103 char:1
+ $rand = [System.Random]::new()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

ERROR: Method invocation failed because [System.Version] does not contain a method 
named 'new'.
ERROR: At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
-EditorServices.ps1:136 char:1
+ $parsedVersion = [System.Version]::new($EditorServicesVersion)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

ERROR: Add-Type : Unable to load one or more of the requested types. Retrieve the 
LoaderExceptions property for more information.
At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules\Power
ERROR: ShellEditorServices\PowerShellEditorServices.psm1:2 char:5
+     Add-Type -Path 
"$PSScriptRoot/bin/Desktop/Microsoft.PowerShell.EditorService ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
ERROR:     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoad 
   Exception
    + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Mi 
   crosoft.PowerShell.Commands.AddTypeCommand

ERROR: You cannot call a method on a null-valued expression.
ERROR: At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
-EditorServices.ps1:108 char:9
ERROR: +         $port = $rand.Next(10000, 30000)
ERROR: +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
ERROR:  
ERROR: Method invocation failed because [System.Net.Sockets.TcpListener] does not 
contain a method named 'new'.
ERROR: At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
-EditorServices.ps1:85 char:9
+         $tcpListener = [System.Net.Sockets.TcpListener]::new($ipAddress, 
$portNu ...
+         
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
ERROR:     + FullyQualifiedErrorId : MethodNotFound

ERROR: You cannot call a method on a null-valued expression.
At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
ERROR: -EditorServices.ps1:108 char:9
+         $port = $rand.Next(10000, 30000)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

ERROR: Method invocation failed because [System.Net.Sockets.TcpListener] does not 
contain a method named 'new'.
ERROR: At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
-EditorServices.ps1:85 char:9
+         $tcpListener = [System.Net.Sockets.TcpListener]::new($ipAddress, 
$portNu ...
+         
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

ERROR: Method invocation failed because [System.Version] does not contain a method 
named 'new'.
ERROR: At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\modules\Power
ShellEditorServices\PowerShellEditorServices.psm1:53 char:5
+     $hostDetails = 
[Microsoft.PowerShell.EditorServices.Session.HostDetails]::ne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: ~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

ERROR: Start-EditorServicesHost : PowerShell Editor Services host initialization 
ERROR: failed, terminating.
At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
-EditorServices.ps1:156 char:5
+     Start-EditorServicesHost `
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
ERROR:    n,Start-EditorServicesHost

ERROR: Start-EditorServicesHost : System.Management.Automation.RuntimeException: 
ERROR: Method invocation failed because 
ERROR: [Microsoft.PowerShell.EditorServices.Host.EditorServicesHost] does not contain 
ERROR: a method named 'new'.
ERROR:    at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(F
unctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(Inte
rpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.
ERROR: Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.
Run(InterpretedFrame frame)
At C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start
ERROR: -EditorServices.ps1:156 char:5
+     Start-EditorServicesHost `
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR:     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
   tion
ERROR:     + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
   n,Start-EditorServicesHost

OUTPUT: {"debugServicePort":null,"status":"started","channel":"tcp","languageServicePort":null}
Connecting to port: null
ERROR: C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start-Ed
ERROR: itorServices.ps1 : 
Caught error while waiting for EditorServicesHost to complete:
You cannot call a method on a null-valued expression.
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, 
T0 arg0)
   at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(Interpr
etedFrame frame)
ERROR:    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.
Run(InterpretedFrame frame)
At line:1 char:1
+ C:\Users\vagrant\.vscode\extensions\ms-vscode.PowerShell-0.7.0\scripts\Start-
ERROR: Edi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
ERROR:    tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
   n,Start-EditorServices.ps1


powershell.exe terminated with exit code: 0

@rgl
Copy link
Author

rgl commented Aug 20, 2016

Installing PowerShell 5.0 fixes the problem (Windows 2012 R2 comes with PS 4.0).

@daviwil
Copy link
Contributor

daviwil commented Aug 22, 2016

Ahhh! Yes, others have seen this issue too. Thanks a lot for sending along these logs. I'll track this issue over at #248 since a few people have reported it there as well. Glad you were able to get around it!

@daviwil daviwil closed this as completed Aug 22, 2016
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

No branches or pull requests

2 participants