Repository navigation
PowerShell 7.2-Preview.7 bombs in Windows Terminal with System.TypeLoadException #15673
Copy link
Copy link
Closed
Closed
Copy link
Labels
Needs-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.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to the known issues.
Steps to reproduce
Just did the automatic Windows update to PowerShell 7.2 Preview.7.

- Click on Wndows "Start", then on the PowerShell 7.2 Preview shortcut.
- 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'.
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs-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.

Activity
MaximoTrinidad commentedon 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 commentedon Jun 25, 2021
Yes, 2.2.0-beta3 is needed. Please report the issue in #15510
MaximoTrinidad commentedon Jun 25, 2021
I'm trying to install PSRL 2.2.-beta3 with elevated privileges, but it is failing:
I will figure it out! :)
MaximoTrinidad commentedon 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 commentedon Jun 25, 2021
Ilya (@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 commentedon Jun 26, 2021
Installing to C:\program files\ has always required elevated permissions.
aungminko93750 commentedon Jun 28, 2021