I have added Sharepoint reference in my project. Even after adding reference, it is showing:
SharePointOnlineCredentials Missing or not found.
Can anyone suggest a solution?
I have added Sharepoint reference in my project. Even after adding reference, it is showing:
SharePointOnlineCredentials Missing or not found.
Can anyone suggest a solution?
I faced the same issue
It was due to the reason that I did not install the Microsoft.SharePoint.Client.Runtime package in the NuGet
Make sure that both the NuGet packages are installed in the solution
Microsoft.SharePoint.Client
and
Microsoft.SharePoint.Client.Runtime
using Microsoft.SharePoint.Client;
in your referencesEven having SharePoint references if you are not targeting .NET Framework, the error occurs because the SharePointOnlineCredentials
class is not present in CSOM for .NET Standard.
You can see the explanation here (as @Aaron noticed): https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-dotnet-standard#using-modern-authentication-with-csom-for-net-standard.
Using user/password based authentication, implemented via the
SharePointOnlineCredentials
class, is a common approach for developers using CSOM for .NET Framework. In CSOM for .NET Standard this isn't possible anymore, it's up to the developer using CSOM for .NET Standard to obtain an OAuth access token and use that when making calls to SharePoint Online.
Its possible that you are missing a reference to another required assembly. Check this out - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.sharepointonlinecredentials.aspx.
If that doesn't solve it, check to be sure that you are using the correct SDK/runtime versions for the Sharepoint version you are trying to deploy for.