Static methods in PSClasses are sometimes marshaled to disposed runspaces
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Comece com ReproSteps.zip e logs.zip e, em seguida, siga as etapas listadas de Test-Class e Get-BoundRunspace enquanto rastreia a propriedade do runspace dos métodos estáticos entre First.ps1 e Second.ps1. Está concluído quando o comando é executado com sucesso em ambas as execuções e Get-BoundRunspace relata o runspace padrão atual em vez de um descartado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- C#
- Estrelas
- 767
- Forks
- 266
- Merge médio
- 3d 16h
- PRs com merge (30d)
- 1
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/PowerShellEditorServices
-
[Bug] None of the string overloads of `EditorExtensionServiceProvider.GetService()` work on .NET. Aberta
PowerShell/PowerShellEditorServices#2331 · 1 reação · 2 responsáveis ·
-
Area-Language Server Issue-Enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
PowerShell/PowerShellEditorServices#2315 · 1 comentário ·
-
Area-Debugging Issue-Enhancement
PowerShell/PowerShellEditorServices#2294 · 1 reação · 2 responsáveis ·
-
Issue-Bug Needs: Triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
PowerShell/PowerShellEditorServices#2293 · 1 comentário ·
-
PowerShell/PowerShellEditorServices#2282 · 1 comentário · 1 reação · 2 responsáveis ·
Todas as issues de PowerShell/PowerShellEditorServices
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
nightscout/nocturne#1425 ·
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
-
Documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Dificuldade 2/5 1-2 dias Facilidade para iniciantes 75/100
Altinn/altinn-auth#4143 ·