Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

SharePointOnlineCredentials

$
0
0

I am using .NET 8.0 C# for connecting to SharePoint. I am getting an error:

The type or namespace SharePointOnlineCredentials" could not be found.

I have added NuGet packages but still I am getting this error.

using (ClientContext ctx = new ClientContext("myUrl")){    SecureString password = new SecureString();    foreach (char c in "MyPassword".ToCharArray())         password.AppendChar(c);    ctx.Credentials = new SharePointOnlineCredentials("MyMailid", password);    Web myWeb = ctx.Web;    ListCreationInformation listinfo = new ListCreationInformation();    listinfo.Title = "Company_Announcemennt";    listinfo.Description = "Add company announcements here!";    listinfo.TemplateType = (int)ListTemplateType.Announcements;    List myList = myWeb.Lists.Add(listinfo);    myList.OnQuickLaunch = true;    myList.Update();    ctx.ExecuteQuery();}

enter image description here


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>