Skip to content
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

System.Security.Cryptography.SHA256Cng fails to load #50

Closed
3vi1 opened this issue Aug 2, 2019 · 7 comments
Closed

System.Security.Cryptography.SHA256Cng fails to load #50

3vi1 opened this issue Aug 2, 2019 · 7 comments

Comments

@3vi1
Copy link

3vi1 commented Aug 2, 2019

Steps to reproduce

09:52:41 evil@P950ER ~/Downloads» pwsh
PowerShell 6.2.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /data/Downloads> install-module Microsoft.Graph.Intune
PS /data/Downloads> Import-Module Microsoft.Graph.Intune
PS /data/Downloads> Connect-MSGraph

Expected behavior

I expected to be prompted for credentials and connect to the graph API.

Actual behavior

Connect-MSGraph : Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
At line:1 char:1
+ Connect-MSGraph
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Connect-MSGraph], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets.Connect

Environment data

----                           -----
PSVersion                      6.2.2
PSEdition                      Core
GitCommitId                    6.2.2
OS                             Linux 5.2.0-8-generic PowerShell/PowerShell#9-Ubuntu SMP Mon Jul 8 13:07:27 UTC 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

This was tested with the current snap and current Ubuntu 19.10 (Eoan Ermine) repos.

@iSazonov
Copy link

iSazonov commented Aug 5, 2019

@3vi1 Please check with latest 7.0 preview.

@3vi1
Copy link
Author

3vi1 commented Aug 6, 2019

@iSazonov The currently available powershell preview snap seg-faults after simply waiting 30 seconds at the command line.

05:43:16 evil@P950ER ~» sudo snap install powershell-preview --classic
powershell-preview 7.0.0-preview.2 from Microsoft PowerShell✓ installed
05:43:25 evil@P950ER ~» pwsh-preview 
PowerShell 7.0.0-preview.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/evil> Segmentation fault (core dumped)

@iSazonov
Copy link

iSazonov commented Aug 6, 2019

@3vi1 I think we don't support Ubuntu 19.10. You could test on 18.04 (that is LTS).

@3vi1
Copy link
Author

3vi1 commented Aug 6, 2019

It doesn't work with 18.04 either:

evil@uvm2:~$ sudo snap refresh powershell-preview 
snap "powershell-preview" has no updates available
evil@uvm2:~$ pwsh-preview 
PowerShell 7.0.0-preview.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/evil> Install-Module Microsoft.Graph.Intune
PS /home/evil> Import-Module Microsoft.Graph.Intune
PS /home/evil> Connect-MSGraph
Connect-MSGraph : Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.                                                                  At line:1 char:1                                                                
+ Connect-MSGraph
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Connect-MSGraph], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets.Connect

nor does it work when building directly from the latest source (which allows me to run on 19.10 without segfault):

18:30:29 evil@P950ER ~/src/PowerShell» ./src/powershell-unix/bin/Debug/netcoreapp3.0/linux-x64/publish/pwsh
PowerShell 7.0.0-preview.2-37-g9eb5587d07473435231d2177b10dd471712fef0c
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/evil/src/PowerShell> Install-Module Microsoft.Graph.Intune
PS /home/evil/src/PowerShell> Import-Module Microsoft.Graph.Intune
PS /home/evil/src/PowerShell> Connect-MSGraph
Connect-MSGraph : Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
At line:1 char:1
+ Connect-MSGraph
+ ~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Connect-MSGraph], TypeLoadException
+ FullyQualifiedErrorId : System.TypeLoadException,Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets.Connect
 

@iSazonov
Copy link

iSazonov commented Aug 7, 2019

@3vi1 Please report in https://github.com/PowerShell/PowerShellModuleCoverage repo.

GitHub
Track issues related to using Windows PowerShell modules with PowerShell Core 6 - PowerShell/PowerShellModuleCoverage

@ghost
Copy link

ghost commented Oct 3, 2019

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

@ghost ghost closed this as completed Oct 3, 2019
@TravisEz13 TravisEz13 transferred this issue from PowerShell/PowerShell Feb 24, 2020
@kudrom
Copy link

kudrom commented Mar 20, 2020

Same issue on pscore 7.0.0

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants