Microsoft.Graph.Authentication fails after removal and re-import in the same PowerShell session
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start with GraphLoadContextInitializer and the dependency-isolation changes from #3789, then reproduce the import/remove/re-import sequence in one PowerShell process. Regression coverage should verify subsequent command execution and load-context behavior, with the module continuing to resolve Microsoft.Graph.Authentication.Core after re-import.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
After the dependency-isolation changes introduced in #3789 , removing and re-importing Microsoft.Graph.Authentication in the same PowerShell 7+ session can leave dependency resolution broken.
Actual Behavior
Re-import or subsequent command execution can fail when resolving Microsoft.Graph.Authentication.Core.
Root Cause
Removing the module calls GraphLoadContextInitializer.Shutdown(), which unregisters the default-context resolver but retains the non-collectible private load context.
On re-import, Initialize() returns immediately because that context already exists, leaving the resolver unregistered. The binary module’s static constructor also does not run again.
Proposed Fix
Track resolver registration separately from context creation. Reuse the existing private context and re-register the resolver on subsequent imports.
Add regression coverage for importing, removing, and re-importing the module within one PowerShell process, followed by command execution and load-context assertions.
Fixed by PR: #3804
Expected behavior
The module can be removed and re-imported successfully, and its commands continue working with dependencies loaded into the private assembly load context.
How to reproduce
Using a build containing #3789 (v2.41):
Import-Module Microsoft.Graph.Authentication
Remove-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Authentication
SDK Version
2.41.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Lingua principale
- C#
- Stelle
- 902
- Fork
- 233
- Merge medio
- 1g 22h
- PR unite (30g)
- 29
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-powershell
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
I maintainer di solito rispondono entro 2 giorni
-
status:waiting-for-triage type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
microsoftgraph/msgraph-sdk-powershell#3822 ·
I maintainer di solito rispondono entro 2 giorni
-
Microsoft.Graph.Authentication dependency Microsoft.Graph.Authentication.Loader.dll is unsignedApertastatus:waiting-for-triage type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
microsoftgraph/msgraph-sdk-powershell#3819 ·
I maintainer di solito rispondono entro 2 giorni
-
Connect-MgGraph on 2.41 crashes when making a connection with cert, fixes when using 2.39 or lowerApertastatus:waiting-for-triage type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
microsoftgraph/msgraph-sdk-powershell#3816 ·
I maintainer di solito rispondono entro 2 giorni
-
status:waiting-for-triage type:feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoftgraph/msgraph-sdk-powershell#3806 · 3 commenti · 3 reazioni ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoftgraph/msgraph-sdk-powershell
Issue simili
-
area:jobads-cv BE mvp P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
klasolsson81/jobbliggaren#2099 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
0 - Backlog Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
BrighterCommand/Brighter#4581 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
Esri/calcite-dotnet-toolkit#30 · 1 reazione ·
-
kind:docs simplification size:S status:todo
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
elsa-workflows/elsa-foundation#2604 ·
I maintainer di solito rispondono entro 1 giorno