You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Microsoft.Graph.Authentication fails after removal and re-import in the same PowerShell session #3805
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.
The module can be removed and re-imported successfully, and its commands continue working with dependencies loaded into the private assembly load context.
Activity
svrooij commentedon Sep 30, 2026
Aleksandar Nikolić (@alexandair) there is already a pr waiting for this issue.
alexandair commentedon Sep 30, 2026
I know. That's why the issue says: Fixed by PR: #3804
I want a trail, so that users are aware of the issue until new version is released.
svrooij commentedon Oct 5, 2026
This will be fixed when version
2.41.1is released