Skip to content

Sites to work with? #356

Answered by jansenbe
tbithell asked this question in Q&A
Mar 13, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@tbithell , sorry for the late response, GitHub discussions don't show a number on top, so I missed this one.

This also works:

using (var context = await pnpContextFactory.CreateAsync(new Uri("https://contoso.sharepoint.com/sites/prov-1")))
{
    // do things
}

You actually do not even need a config file, below is a minimal setup without config file:

class Program
{
    public static async Task Main(string[] args)
    {
        var host = Host.CreateDefaultBuilder()

        // Configure PnP services
        .ConfigureServices((hostingContext, services) =>
        {
            services.AddPnPCore(options =>
            {
                options.DefaultAuthenticationProvider = new Interac…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tbithell
Comment options

@tbithell
Comment options

Answer selected by tbithell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants