darkoperator / darkoperator/Posh-SSH

Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0

Open
#469 24 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.1k
Forks
222
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am trying to load Posh-SSH from a vmware/powerclicore docker image but cannot load it.

PS /root> Install-Module -Name Posh-SSH -RequiredVersion 3.0.4 -Verbose
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Posh-SSH'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'Posh-SSH'.
VERBOSE: Performing the operation "Install-Module" on target "Version '3.0.4' of module 'Posh-SSH'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in '/root/.local/share/powershell/Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'Posh-SSH' with version '3.0.4' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Posh-SSH'' for ''.
VERBOSE: InstallPackage' - name='Posh-SSH', version='3.0.4',destination='/tmp/1212229673'
VERBOSE: DownloadPackage' - name='Posh-SSH', version='3.0.4',destination='/tmp/1212229673/Posh-SSH.3.0.4/Posh-SSH.3.0.4.nupkg', uri='https://www.powershellgallery.com/api/v2/package/Posh-SSH/3.0.4'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/Posh-SSH/3.0.4'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/Posh-SSH/3.0.4'.
VERBOSE: Completed downloading 'Posh-SSH'.
VERBOSE: InstallPackageLocal' - name='Posh-SSH', version='3.0.4',destination='/tmp/1212229673'
VERBOSE: Validating the 'Posh-SSH' module contents under '/tmp/1212229673/Posh-SSH.3.0.4' path.
VERBOSE: Test-ModuleManifest successfully validated the module manifest file '/tmp/1212229673/Posh-SSH.3.0.4'.
VERBOSE: Module 'Posh-SSH' was installed successfully to path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4'.

PS /root> Import-Module -Name Posh-SSH -Verbose
VERBOSE: Loading module from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Posh-SSH.psd1'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Newtonsoft.Json.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Newtonsoft.Json.dll'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Renci.SshNet.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/Renci.SshNet.dll'.
VERBOSE: Loading 'Assembly' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/SshNet.Security.Cryptography.dll'.
VERBOSE: Loading 'Executable' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Assembly/SshNet.Security.Cryptography.dll'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/SSHSession.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/SFTPSession.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/Renci.SshNet.SshCommand.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path '/root/.local/share/powershell/Modules/Posh-SSH/3.0.4/Format/Renci.SshNet.Sftp.SftpFile.Format.ps1xml'.
Import-Module: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.

Here is the versions of powershell

Name                           Value
----                           -----
PSVersion                      7.1.5
PSEdition                      Core
GitCommitId                    7.1.5
OS                             Linux 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

I hope you have a solution.

regards,

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in the vmware/powerclicore Docker image with PowerShell 7.1.5 by installing Posh-SSH 3.0.4 and importing it. Start with the module manifest and the Assembly/Newtonsoft.Json.dll path shown in the report, then identify why the declared assembly cannot load. Done means Import-Module Posh-SSH succeeds in that environment.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.