The type or namespace 'SharePointOnlineCredentials' could not be found.

Ariel M 51 Reputation points
2022-10-12T13:45:35.13+00:00

How do you resolve this error? I installed SharePoint.Client and SharePoint.Client.Runtime. I referenced Microsoft.SarePoint.Client in my app.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,685 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,913 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 35,466 Reputation points Microsoft Vendor
    2022-10-13T02:39:49.157+00:00

    Hi @Ariel M
    Per my test, please check if you created .NET standard instead of .NET framework. If so you will need to recreate a .NET framework like following
    249922-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-10-13-102006.png
    Then we can install CSOM by nuget package
    249892-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-10-13-100823.png
    249894-%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2022-10-13-100856.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ariel M 51 Reputation points
    2022-10-17T17:02:00.367+00:00

    I added it but there's a yellow triangle with an exclamation mark in it on the reference.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.