Manuel
Manuel

Reputation: 675

Accessing Sharepoint 2016 with .Net Core 8.0 fails with 401 Unauthorized Error, with .Net Framework 4.7.1 everything is fine

I am trying to access a SharePoint 2016. If I am using that code in a .Net Framework 4.7.1 application everything works as expected:

using (var clientContext = new ClientContext("<sharepoint_url>"))
{
    clientContext.Credentials = new NetworkCredential("username", "password");
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
}

However if I am using the exact same code in a .Net 8.0 Project, the ExecuteQuery fails with a 401 Unauthorized Error.

I found the same problem already mentioned here: https://stackoverflow.com/a/75125846

However I am not sure, if there is really no solution for that problem. Maybe anyone knows, why this is not working in .Net 8.0?

Thanks!

Upvotes: 1

Views: 157

Answers (0)

Related Questions