Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

System.Text.Json assembly conflict with Az.Accounts

Ouverte
#2,063 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
csharp, powershell
Domaine
backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
C#
Étoiles
578
Forks
114
Merge moyen
14 h 27 min
PR mergées (30 j)
7

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PowerShell/PSResourceGet

Toutes les issues de PowerShell/PSResourceGet

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.