Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Graph PowerShell 2.41.0: Connect-MgGraph fails loading System.Text.Json 10; downgrading to 2.40.0 resolves

Fechada
#3,810 3 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@svrooij já está trabalhando nisso.

Desde 5/10/2026.

  • #3813 de @svrooij — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
azure, powershell
Domínio
api, authentication

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Needs: Attention :wave: status:waiting-for-triage type:bug
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.Graph module 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 ?

Linguagem predominante
C#
Estrelas
901
Forks
232
Merge médio
2d 1h
PRs com merge (30d)
26

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de microsoftgraph/msgraph-sdk-powershell

Todas as issues de microsoftgraph/msgraph-sdk-powershell

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.