Static methods in PSClasses are sometimes marshaled to disposed runspaces
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez par ReproSteps.zip et logs.zip, puis suivez les étapes Test-Class et Get-BoundRunspace indiquées tout en retraçant la propriété du runspace des méthodes statiques dans First.ps1 et Second.ps1. C’est terminé lorsque la commande réussit lors des deux exécutions et que Get-BoundRunspace signale le runspace par défaut actuel plutôt qu’un runspace supprimé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Steps to reproduce
-
Download an extract in the included example.
-
Move the folder "Example" into your PSModulePath
-
Open the folder "Example2" in VSCode
-
Open the file "First.ps1" and run the command
Test-Class(this is a function from "Example") -
(Optional) Run the command included in "First.ps1", this will show the runspace the static method is currently bound to.
-
Open the file "Second.ps1" and run the command
Test-Classagain. -
(Optional) Run
Get-BoundRunspaceagain.
Expected results
The command Test-Class to output Test was successful both times, and Get-BoundRunspace to return the current default runspace both times.
Actual results
The command Test-Class works the first time, but after the second file is opened it throws a null reference exception and Get-BoundRunspace shows a runspace that is no longer open.
Notes
The steps are exact, if Test-Class isn't ran before switching files, or if "Second.ps1" is loaded first, it won't happen.
Although the steps may seem strange, this happens to me frequently if my module is in the module path, and makes static methods in classes not viable. My assumption is that PSES creates a runspace for PSSA which then loads the module causing that execution context to be the new owner. The runspace is then disposed, but the owner doesn't revert.
- Langage dominant
- C#
- Étoiles
- 767
- Forks
- 266
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 1
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Ouverte
PowerShell/PowerShellEditorServices#2331 · 1 réaction · 2 personnes assignées ·
-
Area-Language Server Issue-Enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
PowerShell/PowerShellEditorServices#2315 · 1 commentaire ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 réaction · 2 personnes assignées ·
-
Issue-Bug Needs: Triage
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
PowerShell/PowerShellEditorServices#2293 · 1 commentaire ·
-
PowerShell/PowerShellEditorServices#2282 · 1 commentaire · 1 réaction · 2 personnes assignées ·
Toutes les issues de PowerShell/PowerShellEditorServices
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
nightscout/nocturne#1425 ·
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
cake-build/cake#5024 ·
-
Gå gjennom ESLint-suppressions OuverteFrontend status/draft TechnicalDebt
Difficulté 2/5 1-2 jours Accessibilité débutants 75/100
Altinn/altinn-auth#4143 ·