Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

System.Text.Json assembly conflict with Az.Accounts

未關閉
#2,063 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
csharp, powershell
領域
backend

研究方向

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 內容生成。

描述

Needs-Triage
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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PowerShell/PSResourceGet 的其他 Issue

查看 PowerShell/PSResourceGet 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。