Skip to content

Conflict of Newtonsoft.Json between PSES and Azure PowerShell #2030

Closed
@isra-fel

Description

@isra-fel

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Original issues: PowerShell/PowerShell#19646 , Azure/azure-powershell#21811

To reproduce, install the latest "Az" module and run the following script in a Windows PowerShell session hosted by the PowerShell extension of vscode.

$AzureContext = (Connect-AzAccount).context
Select-AzSubscription -Context $AzureContext
$global:AzStorageContext = (Get-AzStorageAccount).Context #<--- error happens here in visual studio code

Expected behavior

Should be able to assign storage account context

Actual behavior

Get-AzStorageAccount : Method 'get_SerializationSettings' in type 'Microsoft.Azure.Management.Storage.StorageManagementClient' from assembly 'Microsoft.Azure.PowerShell.Storage.Management.Sdk, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

Error details

Get-AzStorageAccount : Method 'get_SerializationSettings' in type 'Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient' from assembly 
'Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
At line:1 char:1
+ Get-AzStorageAccount
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-AzStorageAccount], TypeLoadException
    + FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.22621.963
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.963
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

3.8.4, the one comes with vscode PowerShell extension 2023.5.0

Visuals

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions