【问题标题】:Connect-PnPOnline : Could not load type 'System.Security.SecureString'Connect-PnPOnline:无法加载类型“System.Security.SecureString”
【发布时间】:2019-02-06 19:56:15
【问题描述】:

Azure 上,我使用 microsoft/iis:nanoserver 映像创建了一个 Windows 容器。我正在尝试在其中运行 SharepointPnPPowershellOnline Cmdlet,它会在 Connect-PnPOnline 上引发以下异常。

PS C:\> Connect-PnPOnline -Url https://xyz.sharepoint.com -CurrentCredentials
Could not load type 'System.Security.SecureString' from assembly 'mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=7bc...'.
At line:1 char:1
+ Connect-PnPOnline -Url https://xyz.sharepoint.com -CurrentC ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], TypeLoadException
    + FullyQualifiedErrorId : System.TypeLoadException

我已经在 windows docker 容器中安装了 AzureADSharePointPnPPowerShellOnline 插件。我尝试使用其他连接选项,包括 AccessToken、ClientId、Get-Credentials 等,在所有这些方面,我都面临同样的问题。

非常感谢任何帮助。

【问题讨论】:

    标签: .net-core sharepoint-online azure-container-instances powershell-core


    【解决方案1】:

    Windows Nano Server 不包含 .NET Framework,并且 System.Security.SecureString 也丢失了。您必须 install NuGet 包 System.Security.SecureString 才能在 Nano Server 上使用它。

    【讨论】:

    • 非常感谢 Lukas 的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-20
    • 2017-09-30
    • 2019-02-12
    • 1970-01-01
    • 1970-01-01
    • 2012-08-14
    • 2015-08-28
    相关资源
    最近更新 更多