Azure / Azure/azure-powershell

Connect-AzAccount fails with error: [Assembly with same name is already loaded] after successfully authenticated with Connect-PartnerCenter

Open
#27,048 1 comment 0 reactions 0 assignees View on GitHub
customer-reported needs-triage question
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

The execution of the cmdlet Connect_PartnerCenter is successful.
Then the execution of the cmdlet Connect-AzAccount fails with the module could not be loaded due to the following error: [Assembly with same name is already loaded]

Or the execution of the cmdlet Connect-AzAccount is successful.
And then the execution of the cmdlet Connect_PartnerCenter fails with the module could not be loaded due to the following error: [Assembly with same name is already loaded]

### Script or Debug output

```PowerShell

```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 4.0.2 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzConte…
Script 3.0.10 PartnerCenter {Add-PartnerCustomerCartLineItem, Add-PartnerCusto
```

### Error output

```PowerShell
Resolve-AzError: The 'Resolve-AzError' command was found in the module 'Az.Accounts', but the module could not be loaded due to the following error: [Assembly with same name is already loaded]
For more information, run 'Import-Module Az.Accounts'.
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue on Windows 10 with PowerShell 7.4.6, Az.Accounts 4.0.2, and PartnerCenter 3.0.10, running Connect-PartnerCenter and Connect-AzAccount in both orders. Inspect the module-loading behavior around these two entry points; done means both commands can be used in either order without the duplicate-assembly error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.