dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
139 stars 263 forks source link

Error on Windows 7 (Property setting is supported only on core types in this language mode) #58

Open StephenWeatherford opened 4 years ago

StephenWeatherford commented 4 years ago

Original bug here: https://github.com/microsoft/vscode-azurearmtools/issues/549, filed by @cetincig

This extension requires .NET Core for full functionality. [dotnet 2.2.5]: Found an incompletely-installed version of dotnet 2.2.5... Uninstalling. [dotnet 2.2.5]: Uninstalling dotnet version 2.2.5 [dotnet 2.2.5]: Removing folder c:\Users\ccig.exterieur@fp-lp.fr\AppData\Roaming\Code\User\globalStorage\msazurermtools.azurerm-vscode-tools.dotnet\2.2.5 [dotnet 2.2.5]: Finished removing folder c:\Users\ccig.exterieur@fp-lp.fr\AppData\Roaming\Code\User\globalStorage\msazurermtools.azurerm-vscode-tools.dotnet\2.2.5 [dotnet 2.2.5]: Finished uninstalling dotnet version 2.2.5 Using this command to install .NET Core version 2.2.5: "c:\Users\ccig.exterieur@fp-lp.fr.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.8.4\assets\install scripts\dotnet-install.cmd" -InstallDir 'c:\Users\ccig.exterieur@fp-lp.fr\AppData\Roaming\Code\User\globalStorage\msazurermtools.azurerm-vscode-tools.dotnet\2.2.5' -Runtime dotnet -Version 2.2.5 Downloading .NET Core tooling version(s) 2.2.5............[dotnet 2.2.5]: STDERR: Cannot set property. Property setting is supported only on core types in this language mode. At line:1 char:1

Cannot set property. Property setting is supported only on core types in this language mode. At line:1 char:63

C:\Users\ccig.exterieur@fp-lp.fr.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.8.4\assets\install scripts\dotnet-install.ps1 : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:126

Cannot set property. Property setting is supported only on core types in this language mode. At line:1 char:63

C:\Users\ccig.exterieur@fp-lp.fr.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.8.4\assets\install scripts\dotnet-install.ps1 : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:126

Error: >>>> This extension requires .NET Core for full functionality, but we were unable to download and install a local copy for the extension. If this error persists, please see https://aka.ms/vscode-armtools-dotnet for troubleshooting tips. Cannot set property. Property setting is supported only on core types in this language mode. At line:1 char:1

Cannot set property. Property setting is supported only on core types in this language mode. At line:1 char:63

C:\Users\ccig.exterieur@fp-lp.fr.vscode\extensions\msazurermtools.azurerm-vscode-tools-0.8.4\assets\install scripts\dotnet-install.ps1 : Cannot invoke method. Method invocation is supported only on core types in this language mode. At line:1 char:126

sfoslund commented 4 years ago

Based on some initial investigation, it looks like the problem is probably your powershell language mode. @cetincig, what is the output when you run $ExecutionContext.SessionState.LanguageMode in powershell?

cetincig commented 4 years ago

I resolved the problem. I add this key in regitry (set language mode to FullLanguage) and I restart my machine : [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment] "__PSLockdownPolicy"="1"

sfoslund commented 4 years ago

In general I'm not sure that there's any way to work around this in the extension, we need to have access to powershell to be able to install. @NTaylorMullen @wli3 do you have any ideas?

NTaylorMullen commented 4 years ago

@NTaylorMullen @wli3 do you have any ideas?

My only idea to workaround it would be a nuclear option where you replicate all of the powershell logic in node 😢