MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Could not load type 'System.Security.Cryptography.SHA256Cng' #98059

Open alumriel opened 2 years ago

alumriel commented 2 years ago

Windows 10, version 20H2, build 19042.1889 AzureADPreview module 2.0.2.149 Powershell 7.2.6

When running command "connect-azuread", I get the following error:

Connect-AzureAD: One or more errors occurred. (Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

alumriel commented 2 years ago

Update - "ConnectAzureAD" appears to work fine in Powershell 5.1.19041.1682

JamesTran-MSFT commented 2 years ago

@alumriel Thanks for your feedback! We will investigate and update as appropriate.

amsliu commented 2 years ago

@alumriel Thank you for your feedback. I am double checking this with our product team.

amsliu commented 1 year ago

reassign @rkarim-ms

amsliu commented 1 year ago

@JamesTran-MSFT could you please re-assign this issue to the PM @rkarim-ms? We are pending clarification from the product side. Thanks!

ReySys commented 2 weeks ago

Same error running command Connect-MgGraph

Only Microsoft Graph, Intune, MSAL.PS, JWTDetails modules installed.

Update Microsoft.Graph - FAIL

uninstall and test - JWTDetails FAIL uninstall and test - MSAL.PS FAIL uninstall and test - Microsoft.Graph.Intune FAIL

uninstall of Microsoft.Graph but FAILED the uninstall install again Microsoft.Graph - FAIL

I follow the following article to remove each module and versions.

https://bonguides.com/how-to-uninstall-microsoft-graph-powershell-modules-completely/

The article shows you all the modules installed, and the different versions installed. Help to remove each version. Is a long process.

At the end installed Microsoft.Graph & Microsoft.Graph Beta again. All worked fine!

Some modules I had 4 versions and repeated versions.

Hope helps!