Why do i have error on SharePointOnlineCredentials ? namespace not found

帅比萌擦擦* 提交于 2021-01-07 02:43:21

问题


I have CSOM packaged installed as you can see:

And i cannot install sharepoint package or runtime because it says its not compatible with my version 3.1 ...

So this is a repeated question, but the thing is i cant comment and in any other post people tell us to install all this packages i talked before... How can i use SharePointOnlineCredentials? Thanks for any help


回答1:


SharePointOnlineCredentail isn't supported in .NET Standard platform any more.

Please check the official document here for more details:

A solution would register Azure AD App and use this App get the access token for authentcaition.

You can refer the official document above for detailed code sample.




回答2:


All you need is Microsoft.SharePointOnline.CSOM NuGet package. You will find SharePointOnlineCredentials in Microsoft.SharePoint.Client namespace:

 var creds = new SharePointOnlineCredentials(username, password);


来源:https://stackoverflow.com/questions/64026245/why-do-i-have-error-on-sharepointonlinecredentials-namespace-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!