dotnet / dotnet/vscode-dotnet-runtime

PowerShell LanguageMode: ConstrainedLanguage causing Installation failed

Open
#487 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
209
Forks
455
PR merge metrics
No merged PRs in 30d

Description

The issue text was copied to the clipboard. Please paste it into this window.

Please attach the log file located at [DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1655313344149.txt](https://github.com/dotnet/vscode-dotnet-runtime/files/8911658/DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1655313344149.txt)DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1655313344149.txt. Note that this file may contain personal data.

Privacy Alert! The contents copied to your clipboard may contain personal data. Prior to posting to GitHub, please remove any personal data which should not be publicly viewable. https://privacy.microsoft.com/en-US/privacystatement

I believe this is related to my machine constantly getting set into ContrainedLanguage mode in Powershell:
PS> $ExecutionContext.SessionState.LanguageMode
ConstrainedLanguage

Is there any way to get around this (i.e., not use PowerShell)?

**Repro steps:**
1. Get into ContrainedL,anguage mode and
2. Trigger loading of Azure Resource Manager Tools
1. Extension version upgrading (?) which causes the below error.

**Extension Version:** 1.0.0
**Error Message:** .NET Acquisition Failed: Installation failed: Cannot set property. Property setting is supported only on core types in this language mode.
At line:1 char:5
+ & { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointMa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertySetterNotSupportedInConstrainedLanguage

**Error Stack:** Error: .NET Acquisition Failed: Installation failed: Cannot set property. Property setting is supported only on core types in this language mode.
At line:1 char:5
+ & { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointMa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertySetterNotSupportedInConstrainedLanguage

at c:\Users\anonymous\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.5.0\dist\extension.js:2:13750
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.