System.Text.Json assembly conflict with Az.Accounts
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by investigating how PSResourceGet loads or references System.Text.Json and compare that with the version loaded by Az.Accounts; the issue provides version and module-path details but names no source files or tests. Reproduce in Windows PowerShell 5.1 by loading PSResourceGet before running Connect-AzAccount -Identity; done means that sequence no longer causes the reported authentication failure.
由索引模型根据 Issue 内容生成。
描述
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
Steps to reproduce
If PSResourceGet is loaded in the session, and then try to execute Connect-AzAccount -Identity it produces an error.
If PSResourceGet is not loaded before executing Connect-AzAccount -Identity it works.
Expected behavior
That PSResourceGet being loaded should not cause issues with the execution of other PowerShell modules.
Actual behavior
When PSResourceGet is in the session, it can cause modules like Az.Account to have issues.
Error details
Connect-AzAccount : ManagedIdentityCredential authentication failed: The type initializer for
'Microsoft.Identity.Client.Platforms.net.MsalJsonSerializerContext' threw an exception.
See the troubleshooting guide for more information.
https://aka.ms/azsdk/net/identity/managedidentitycredential/troubleshoot
At line:1 char:1
+ Connect-AzAccount -Identity -ErrorAction Stop
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
This appears to be due to the major version differences between the two modules System.Text.Json versions which are conflicting.
Name Version Location
---- ------- --------
System.Text.Json 10.0.0.0 C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\5.5.3\lib\netstandard2.0\S...
System.Text.Json 8.0.0.6 C:\Program Files\WindowsPowerShell\Modules\Microsoft.PowerShell.PSResourceGet\1.2...
Environment data
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 1.2.0 Microsoft.PowerShell.PSResourceGet {Compress-PSResource, Find-PSResource, Get-InstalledPSResour...
Key : PSVersion
Value : 5.1.20348.4294
Name : PSVersion
Key : PSEdition
Value : Desktop
Name : PSEdition
Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name : PSCompatibleVersions
Key : BuildVersion
Value : 10.0.20348.4294
Name : BuildVersion
Key : CLRVersion
Value : 4.0.30319.42000
Name : CLRVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
Visuals
No response
- 主要语言
- C#
- 星标
- 578
- 派生
- 114
- 平均合并
- 14 小时 27 分钟
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/PSResourceGet 的其他 Issue
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory未关闭
难度 2/5 1-3 小时 新手友好度 78/100
PowerShell/PSResourceGet#2056 ·
维护者通常 1 天内回复
-
feature_request
难度 2/5 1-3 小时 新手友好度 68/100
PowerShell/PSResourceGet#2013 · 3 条评论 ·
维护者通常 1 天内回复
-
Needs-Triage
难度 3/5 1-2 天 新手友好度 55/100
PowerShell/PSResourceGet#2061 · 1 条评论 ·
维护者通常 1 天内回复
-
Needs-Triage
难度 3/5 1-2 天 新手友好度 55/100
PowerShell/PSResourceGet#2060 ·
维护者通常 1 天内回复
-
Needs-Triage
难度 3/5 1-2 天 新手友好度 68/100
PowerShell/PSResourceGet#2059 ·
维护者通常 1 天内回复
查看 PowerShell/PSResourceGet 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
PCL-Community/PCL-CE#3658 ·
维护者通常 1 天内回复
-
Deploy & Patch-issues opprettes ikke: create-pnd-issues.yml har feilet hver uke siden 2025-09-08未关闭
难度 2/5 1-3 小时 新手友好度 62/100
Altinn/altinn-auth#4359 ·
维护者通常 1 天内回复
-
アプリ: チャット 優先: 中 提案
难度 2/5 1-3 小时 新手友好度 70/100
yksr-melt/Meltype#243 · 1 条评论 ·
维护者通常 1 天内回复
-
bug core
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
type/automation type/tech-debt
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复