Prerequisites
Steps to reproduce
- Unzip test project to some folder
- Publish binaries
dotnet publish PwshTest.csproj -o .\publish --configuration Release --runtime win10-x64
- Run PwshTest.exe
Expected behavior
Actual behavior
Error details
Seems that creating an instance of WScript.Shell is causing the PS sdk library to hang (looping, since there is cpu usage going on). This is specific to using the --runtime parameter on publish. Publishing without specifying runtime does not hang, and running from sources in Debug and Release does not hang either. Removing creation of WScript.Shell from the script file makes it pass without issues.
Tested in SDK 7.1.5, the latest release for Net5 applications.
Environment data
<TargetFramework>net5.0-windows10.0.19041</TargetFramework>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.5" />
Visuals
Test solution and script: PwshTest.zip
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