using Microsoft.SharePoint.Client; | |
using OfficeDevPnP.Core; | |
using System; | |
namespace CSOMDemo | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var authManager = new AuthenticationManager(); | |
var ctx = authManager.GetWebLoginClientContext("https://contoso.sharepoint.com/"); | |
Web web = ctx.Web; | |
User user = web.CurrentUser; | |
ctx.Load(web); | |
ctx.Load(user); | |
ctx.ExecuteQuery(); | |
Console.WriteLine(web.Title); | |
Console.WriteLine(user.LoginName); | |
Console.ReadLine(); | |
} | |
} | |
} |
This comment has been minimized.
This comment has been minimized.
This API is no longer in the SharePointPnPCoreOnline Nuget package. |
This comment has been minimized.
This comment has been minimized.
try to install an older version that is 3.12.1908 then you can able to use "using OfficeDevPnP.Core;" |
This comment has been minimized.
This comment has been minimized.
Hello, I am getting following error at? authManager.GetWebLoginClientContext(siteUrl);
and If install System.Drawing.Common package, Getting
Any Idea how to solve this? I am using console app project with VS 2019 Thanks. **UPDATE |
This comment has been minimized.
This comment has been minimized.
I am working on provider hosted app with MFA enabled for SharePoint online. Can you please suggest what are the options for user authentication. |
This comment has been minimized.
This comment has been minimized.
Did this solve after changing the .net framework from .net core? Have you developed this in Web or Windows App? |
This comment has been minimized.
OfficeDevPnP.Core.AuthenticationManager is part of the PnP Core Library available here: https://www.nuget.org/packages/SharePointPnPCoreOnline