Search code examples
c#sharepointsharepoint-2010sharepoint-2013

Microsoft.ProjectServer.Client dll is missing


I'm trying to generate lookup tables in SharePoint and taking reference from a sample project. Here is the code snippet I'm referring to:

using Microsoft.SharePoint.Client; 
using Microsoft.ProjectServer.Client;   
using System.Security;
using System.Configuration;

namespace PWA_CSOM
{
    public partial class FinalLogic_Second : System.Windows.Forms.Form
    {
        #region veriables
        private static ProjectContext projContext;
        string pwaPath = "";
        string userId = "";
        string userPassword = "";
    }
}

I have created a new project and created a variable to type ProjectContext, however I'm not able to find the reference for it. I have tried everywhere but no luck:

using Microsoft.ProjectServer.Client;   //Missing Reference

namespace LookupTable
{
    public static class Infrastructure
    {
        #region Properties
        public ProjectContext project;
        #endregion
    }
}

I tried Local Assembly Reference but no luck - Local Reference

Also tried the Nuget Reference - enter image description here

Is there something missed from my end? Any help is appreciated.


Solution

  • Install SharePoint Online CSOM package in Package Manager Console in Visual studio.

    Install-Package Microsoft.SharePointOnline.CSOM -Version 16.1.7723.1200
    

    https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM

    enter image description here