Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

System.Text.Json assembly conflict with Az.Accounts

Abierto
#2,063 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp, powershell
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C#
Estrellas
578
Forks
114
Merge medio
14 h 27 min
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PowerShell/PSResourceGet

Todos los issues de PowerShell/PSResourceGet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.