Graph PowerShell 2.41.0: Connect-MgGraph fails loading System.Text.Json 10; downgrading to 2.40.0 resolves
維護者通常 1 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- azure, powershell
- 領域
- api, authentication
研究方向
Begin with the dependency change associated with #3789 and the Microsoft.Graph.Authentication entry point used by Connect-MgGraph; reproduce on the listed PowerShell and .NET versions. Trace the System.Text.Json 10 load path and verify that the callback connects on 2.41.0 without pinning 2.40.0.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
We encountered an assembly-loading failure at Connect-MgGraph after installing Microsoft Graph PowerShell 2.41.0. Pinning both Microsoft.Graph.Authentication and Microsoft.Graph.Groups to 2.40.0 (the previous version) appears to resolve the failure.
| Component | Version |
|---|---|
| OS | Ubuntu 24.04.4 LTS |
| PowerShell | 7.5.5 |
| PowerShell runtime | .NET 9.0.14 |
| Az.Accounts | 5.3.3 |
| Microsoft.Graph.Authentication | 2.41.0 |
| Microsoft.Graph.Groups | 2.41.0 |
This runs on an ephemeral Azure DevOps agent. An AzurePowerShell@5 task (using pwsh=true) invokes Redgate Flyway, which launches a child pwsh process for a deployment callback. Diagnostics from the task and a seperate child process both reported the runtime and available module versions above.
Expected behavior
We would expect to be able to roll forward without issue.
How to reproduce
The callback imports the following modules and connects using an access token obtained through Az.Accounts:
Import-Module Az.Accounts -ErrorAction Stop
Import-Module Microsoft.Graph.Authentication -ErrorAction Stop
Import-Module Microsoft.Graph.Groups -ErrorAction Stop
$azContext = Get-AzContext -ErrorAction Stop
$graphAccessToken = (
Get-AzAccessToken `
-ResourceTypeName MSGraph `
-TenantId $azContext.Tenant.Id `
-AsSecureString
).Token
Connect-MgGraph -AccessToken $graphAccessToken -NoWelcome
This fails with an assembly-loading error referencing:
System.Text.Json, Version=10.0.0.0
SDK Version
2.41.0
Latest version known to work for scenario above?
2.40.0
Known Workarounds
Rolling back to 2.40.0 works as expected.
- Installing the umbrella
Microsoft.Graphmodule does NOT resolve the failure. - Installing the .NET 10 SDK on the agent did not resolve the failure, but we did not validate that the PowerShell callback ran under .NET 10 (it is believed we'd need to upgrade PowerShell 7 to do this)
Debug output
No response
Configuration
No response
Other information
#3789 seems like the likely culprit, thoughts @svrooij ?
- 主要語言
- C#
- 星號
- 909
- 分支
- 234
- 平均合併
- 3 天 21 小時
- 30 天內合併 PR
- 23
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoftgraph/msgraph-sdk-powershell 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
維護者通常 1 天內回覆
-
[v3 wrappers] Support arbitrary optional query parameters可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉status:waiting-for-triage type:feature
難度 5/5 一週以上 新手友好度 35/100
microsoftgraph/msgraph-sdk-powershell#3897 ·
維護者通常 1 天內回覆
-
Tracking for V3 Upgrade可能已有人在做 @ramsessanchez 於 9 天前認領。 未關閉type:epic
microsoftgraph/msgraph-sdk-powershell#3874 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 48/100
microsoftgraph/msgraph-sdk-powershell#3873 ·
維護者通常 1 天內回覆
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 57/100
microsoftgraph/msgraph-sdk-powershell#3872 ·
維護者通常 1 天內回覆
查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
Facepunch/sbox-public#12305 ·
維護者通常 5 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
JiaFeiMiao-K-Cat/DiscImageStudio#205 ·
維護者通常 1 天內回覆
-
bug keep-fresh
難度 2/5 1-3 小時 新手友好度 68/100
Flow-Launcher/Flow.Launcher#4744 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
flyingpie/windows-terminal-quake#419 ·
維護者通常 1 天內回覆
-
enhancement help wanted
難度 2/5 1-3 小時 新手友好度 82/100