8000 PowerShell 7.2-Preview.7 bombs in Windows Terminal with System.TypeLoadException · Issue #15673 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

PowerShell 7.2-Preview.7 bombs in Windows Terminal with System.TypeLoadException #15673

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
5 tasks done
MaximoTrinidad opened this issue Jun 25, 2021 · 8 comments
Closed
5 tasks done
Labels
Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-Answered The question is answered.

Comments

@MaximoTrinidad
Copy link
MaximoTrinidad commented Jun 25, 2021

Prerequisites

Steps to reproduce

Just did the automatic Windows update to PowerShell 7.2 Preview.7.
Posh_WU_2021-06-25_9-34-08

  1. Click on Wndows "Start", then on the PowerShell 7.2 Preview shortcut.
  2. Windows Terminal opens, but PowerShell ends with an System.TypeLoadException: System.TypeLoadException: Could not load type 'System.Management.Automation.Subsystem.PredictionResult' from assembly 'Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Posh72prev72021-06-25_9-58-14

Expected behavior

To get to the PowerShell prompt without exceptions errors.

Actual behavior

trying to open PowerShell Preview:

PowerShell 7.2.0-preview.7
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Users\max_t>
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.md
Thank you!

### Environment
PSReadLine: 2.2.0-beta2
PowerShell: 7.2.0-preview.7
OS: Microsoft Windows 10.0.21390
BufferWidth: 120
BufferHeight: 30

Last 0 Keys
'''

'''

### Exception
'''
System.TypeLoadException: Could not load type 'System.Management.Automation.Subsystem.PredictionResult' from assembly 'Microsoft.PowerShell.PSReadLine.Polyfiller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at Microsoft.PowerShell.PSConsoleReadLine.PredictionViewBase.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.PredictionInlineView.Reset() in Microsoft.PowerShell.PSReadLine2.dll:token 0x60004ca+0x0
   at Microsoft.PowerShell.PSConsoleReadLine.Prediction.Reset() in Microsoft.PowerShell.PSReadLine2.dll:token 0x600049b+0x7
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics) in Microsoft.PowerShell.PSReadLine2.dll:token 0x6000101+0x118
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken) in Microsoft.PowerShell.PSReadLine2.dll:token 0x60000fa+0x60


### Environment data

```powershell
Microsoft Windows [Version 10.0.21390.2025]

Windows Terminal Preview: Version: 1.9.1523.0

Visuals

No response

@MaximoTrinidad MaximoTrinidad added the Needs-Triage The issue is new and needs to be triaged by a work group. label Jun 25, 2021
@MaximoTrinidad
Copy link
Author
MaximoTrinidad commented Jun 25, 2021

This has been happening to me since PowerShell 7.2-preview.6:#15496
But this issue was closed with the explanation: "This is a known issue that will be fixed when PSRL 2.2.0-beta3 drops".

@iSazonov
Copy link
Collaborator

Yes, 2.2.0-beta3 is needed. Please report the issue in #15510

@iSazonov iSazonov added the Resolution-Answered The question is answered. label Jun 25, 2021
@MaximoTrinidad
Copy link
Author

I'm trying to install PSRL 2.2.-beta3 with elevated privileges, but it is failing:

pwsh -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease -Scope CurrentUser"
Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711
Line |
9711 |  … talledPackages = PackageManagement\Install-Package @PSBoundParameters
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Administrator rights are required to install or update. Log on to the computer with an account that
     | has Administrator rights, and then try again, or install by adding "-Scope CurrentUser" to your
     | command. You can also try running the Windows PowerShell session with elevated rights (Run as
     | Administrator).

I will figure it out! :)

@MaximoTrinidad
Copy link
Author
MaximoTrinidad commented Jun 25, 2021

So, I can manually remove the PSReadline module folder from the 'C:\Program Files\PowerShell\7-preview\Modules" location.
Now, I can open PowerShell 7.2-preview.7 without PSRL.

I still trying to install the PSRL 2.2.0.-beta3... no luck with it! :(

@MaximoTrinidad
Copy link
Author
MaximoTrinidad commented Jun 25, 2021

@iSazonov,

Success!! ... But strange behavior to resolve this issue.

I had to log on with the "Administrator" user-id in order to install PSReadLine 2.2.0-Beta3.
Only then I can go back and sign on with my normal user-id and run PowerShell 7.2-Preview.7 without any issues in Windows Terminal.

I'm good now! But have I notice that when I sign on with the Administrator ID, PowerShell will open the prompt outside Windows Terminal App. I never had to use the Administrator ID for anything, until now.

@iSazonov
Copy link
Collaborator

Installing to C:\program files\ has always required elevated permissions.

@ghost
Copy link
ghost commented Jun 28, 2021

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Jun 28, 2021
@aungminko93750
Copy link
aungminko93750 commented Jun 28, 2021 via email

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage The issue is new and needs to be triaged by a work group. Resolution-Answered The question is answered.
Projects
None yet
Development

No branches or pull requests

3 participants
0