question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'System.Management.Automation.Subsystem.PredictionResult

See original GitHub issue

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-beta1 PowerShell: 7.1.0-preview.2 OS: Microsoft Windows 10.0.19042 BufferWidth: 120 BufferHeight: 9001

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()
   at Microsoft.PowerShell.PSConsoleReadLine.Prediction.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
shentyrentycommented, Nov 9, 2021

Hello there. This problem resurfaced when I updated Powershell to v7.2.0. The following error prompts when I start my terminal.

Environment

PSReadLine: 2.2.0-beta1 PowerShell: 7.2.0 OS: Microsoft Windows 10.0.22000 BufferWidth: 123 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()
   at Microsoft.PowerShell.PSConsoleReadLine.Prediction.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

The following is my Powershell Profile:-

oh-my-posh --init --shell pwsh --config D:\External-GitHub-Repos\github\prompt\ohmyposhv2.json | Invoke-Expression Import-Module -Name Terminal-Icons Import-Module z Import-Module PSReadLine Set-PSReadLineOption -PredictionSource History Set-PSReadLineOption -PredictionViewStyle ListView Set-PSReadLineOption -EditMode Windows

Managed to solve this by updating the PSReadLine module to v2.2.0-beta4. 🥳

I got the same error: Install-Module PSReadLine -AllowPrerelease -Force fixed it - From Scott Hanselman’s Blog: (https://www.hanselman.com/blog/powershell-720-could-not-load-type-systemmanagementautomationsubsystempredictionresult?utm_source=feedly&utm_medium=webfeeds)

7reactions
scotgopalcommented, Nov 9, 2021

Hello there. This problem resurfaced when I updated Powershell to v7.2.0. The following error prompts when I start my terminal.

Environment

PSReadLine: 2.2.0-beta1 PowerShell: 7.2.0 OS: Microsoft Windows 10.0.22000 BufferWidth: 123 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()
   at Microsoft.PowerShell.PSConsoleReadLine.Prediction.Reset()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

The following is my Powershell Profile:-

oh-my-posh --init --shell pwsh --config D:\External-GitHub-Repos\github\prompt\ohmyposhv2.json | Invoke-Expression Import-Module -Name Terminal-Icons Import-Module z Import-Module PSReadLine Set-PSReadLineOption -PredictionSource History Set-PSReadLineOption -PredictionViewStyle ListView Set-PSReadLineOption -EditMode Windows

Managed to solve this by updating the PSReadLine module to v2.2.0-beta4. 🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

PowerShell 7.2.0 - Could not load type System. ...
However, suddenly I started getting this error on every prompt. Could not load type 'System.Management.Automation.Subsystem.PredictionResult' ...
Read more >
System.TypeLoadException: Could not load ...
System.TypeLoadException: Could not load type 'System.Management.Automation.Subsystem.PredictionResult' from assembly 'Microsoft.PowerShell.
Read more >
PredictionResult Class (System.Management.Automation. ...
Learn more about the System.Management.Automation.Subsystem.PredictionResult in the System.Management.Automation.Subsystem namespace.
Read more >
System.Management.Automation.Subsystem.Prediction ...
The class represents a client that interacts with predictors. PredictionContext. Context information about the user input. PredictionResult. The class ...
Read more >
PSReadLine throw exception after upgrading to PS 7.2
TypeLoadException: Could not load type 'System.Management.Automation.Subsystem.PredictionResult' from assembly 'Microsoft.PowerShell.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found