Skip to content

How i can show tracing of how my .net 8.0 console application which uses PnP core SDK interact with sharepoint #1399

Answered by jansenbe
mvcsharepointdev asked this question in Q&A
Discussion options

You must be logged in to vote

@mvcsharepointdev : PnP Core supports .NET logging, so just configure logging in .NET. Below minimal console application sample has been configured to log debug events (see ConfigureLogging method), which then shows the calls made API calls:

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using PnP.Core.Auth;
using PnP.Core.Services;

string clientId = "<guid>";
string siteUrl = "https://bertonline.sharepoint.com/sites/prov-1";

// Creates and configures the host
var host = Host.CreateDefaultBuilder()
    .ConfigureServices((context, services) => 
    {
        // Add PnP Core SDK
        services.AddPnPCore(options =>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jansenbe
Comment options

Answer selected by mvcsharepointdev
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