-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Microsoft.Powershell.Sdk - Script hangs when running from runtime-specific published binary #16901
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-AnsweredThe question is answered.The question is answered.WG-DevEx-SDKhosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of moduleshosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-AnsweredThe question is answered.The question is answered.WG-DevEx-SDKhosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of moduleshosting PowerShell as a runtime, PowerShell's APIs, PowerShell Standard, or development of modules
Type
Fields
Give feedbackNo fields configured for issues without a type.
Prerequisites
Steps to reproduce
dotnet publish PwshTest.csproj -o .\publish --configuration Release --runtime win10-x64Expected behavior
Application exitsActual behavior
Application hangsError details
Seems that creating an instance of
WScript.Shellis causing the PS sdk library to hang (looping, since there is cpu usage going on). This is specific to using the--runtimeparameter on publish. Publishing without specifying runtime does not hang, and running from sources in Debug and Release does not hang either. Removing creation ofWScript.Shellfrom the script file makes it pass without issues.Tested in SDK 7.1.5, the latest release for Net5 applications.
Environment data
Visuals
Test solution and script: PwshTest.zip