You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unable to use the Certes library in PowerShell Core due to the dependency on NewtonSoft.Json 11.0.1. At present you will receive a type init exception as soon as you try to create a new AcmeContext. This is due to the unique way pwsh works where it will stick with the first version of a module it loads, and unfortunately since pwsh itself has a dependency on Newtonsoft.Json, it sticks with the version it loads on startup.
Currently there is no way for a module to have its own AppDomain or context. Until the PowerShell team fix that (maybe in 6.2), please could you revert the version of Newtonsoft.Json used by Certes to 10.0.3? I've grabbed the repo, made the change, and it compiled ok. The referenced assembly then works ok in PowerShell Core.
The text was updated successfully, but these errors were encountered:
I agree it's not really a proper solution, but it's the only one I can see at the moment. Microsoft may add better isolation for imported modules and/or assembly redirects. PowerShell 5.1 is fine at the moment.
It does need to be exactly 10.0.3 since that's what PS Core is using. The Nuspec should be ok with >= 10.0.3 in it though.
* Changed to Newtonsoft.Json 10.0.3 for PowerShell Core
PowerShell Core only supports one version of a referenced assembly per session and it already references Newtonsoft.Json 10.0.3 internally, so provides no opportunity for Certes to reference version 11.x. Until this situation is resolved by Microsoft (potentially in PowerShell Core 6.2) the only workaround is to change the dependency here. See PowerShell/PowerShell#2083 and PowerShell/PowerShell#6757#112
I'm unable to use the Certes library in PowerShell Core due to the dependency on NewtonSoft.Json 11.0.1. At present you will receive a type init exception as soon as you try to create a new AcmeContext. This is due to the unique way pwsh works where it will stick with the first version of a module it loads, and unfortunately since pwsh itself has a dependency on Newtonsoft.Json, it sticks with the version it loads on startup.
See here: PowerShell/PowerShell#2083
Currently there is no way for a module to have its own AppDomain or context. Until the PowerShell team fix that (maybe in 6.2), please could you revert the version of Newtonsoft.Json used by Certes to 10.0.3? I've grabbed the repo, made the change, and it compiled ok. The referenced assembly then works ok in PowerShell Core.
The text was updated successfully, but these errors were encountered: