-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assembly with same name is already loaded #595
Comments
In the $error[0] variable does it provide more info on what assembly is causing the issue? |
With the older version (
It's really hard to troubleshoot as it happens only a couple of times a day. It's probably an issue that happens when loading the assembly at the time the module is loaded from memory that makes it fail to load the Maybe you can add more detailed error handling around the loading of the assemblies? So it spits out more details? |
It happens after this line:
When I run this code, the error shows up again: $modulePath = 'C:\Program Files\PowerShell\Modules\Posh-SSH\3.2.1'
Add-Type -Path "$modulePath/PoshSSH.dll" This code is included within in the module manifest file # List of all files packaged with this module
FileList = @('Posh-SSH.psm1','PoshSSH.dll','Assembly\Newtonsoft.Json.dll','Assembly\Renci.SshNet.dll', 'Assembly\SshNet.Security.Cryptography.dll') Is the Looking at issue #284 it seems to be a bit related. However, running the code below does not generate an error at all: $modulePath = 'C:\Program Files\PowerShell\Modules\Posh-SSH\3.2.1'
@(
'Assembly\Newtonsoft.Json.dll',
'Assembly\Renci.SshNet.dll',
'Assembly\SshNet.Security.Cryptography.dll'
).ForEach(
{ Add-Type -Path "$modulePath/$_" }
) |
Since updating to
3.2.4
we often see this error:We run code in parallel:
This happens quite often. Is there something we're missing?
We never use
Import-Module
and rely on auto loading of modules.This happens on
PowerShell 7.4.5
. We had to revert back to3.2.1
where we don't have this issue.The text was updated successfully, but these errors were encountered: