C# 使用C中的Windows应用程序在SharePoint中上载文件时出现异常#
我想使用C#中的Windows应用程序在SharePoint中上载文件 但我得到了以下错误:C# 使用C中的Windows应用程序在SharePoint中上载文件时出现异常#,c#,sharepoint,sharepoint-online,C#,Sharepoint,Sharepoint Online,我想使用C#中的Windows应用程序在SharePoint中上载文件 但我得到了以下错误: Microsoft.SharePoint.Client.IdcrlException: 'The sign-in name or password does not match one in the Microsoft account system.' 但是,当我将这些凭据手动键入SharePoint网站时,它们工作正常。如果启用多因素身份验证(MFA),您将收到此错误消息 您需要使用下面的命令安装
Microsoft.SharePoint.Client.IdcrlException:
'The sign-in name or password does not match one in the Microsoft account system.'
但是,当我将这些凭据手动键入SharePoint网站时,它们工作正常。如果启用多因素身份验证(MFA),您将收到此错误消息 您需要使用下面的命令安装软件包
Install-Package SharePointPnPCoreOnline -Version 3.17.2001.2
然后使用下面的代码连接SharePoint Online
var authManager = new AuthenticationManager();
var client = authManager.GetWebLoginClientContext("https://jithin32.sharepoint.com/sites/demo");
参考:Office 365:错误很明显。名称或密码有误。这与上载无关。我可以使用相同的用户名和密码登录。错误说明您使用了错误的用户名和密码。我有相同的问题,而MFA是LZ_MSFT指出的问题。但是我仍然需要一个可以作为服务运行的应用程序,以便能够将文件移动到sharepoint。到目前为止,我发现的工作示例都需要您输入信息。如何在无人参与的情况下完成此操作?SharePointPnPCoreOnline已被弃用,建议您改用PnP Framework()
var authManager = new AuthenticationManager();
var client = authManager.GetWebLoginClientContext("https://jithin32.sharepoint.com/sites/demo");