ProjectContext.Projects property

Office 2013 and later

Gets the collection of projects in the Project Web App instance.

Namespace:  Microsoft.ProjectServer.Client
Assembly:  Microsoft.ProjectServer.Client (in Microsoft.ProjectServer.Client.dll)

Public ReadOnly Property Projects As ProjectCollection
Dim instance As ProjectContext
Dim value As ProjectCollection

value = instance.Projects

Property value

Type: Microsoft.ProjectServer.Client.ProjectCollection
A collection of projects.

A project entity contains additional entity types, such as tasks, resources, and assignments.

The following example uses the ProjectContext object to list the published projects in Project Web App. To see the same application using the ProjectServer object, see ProjectContext.Projects. For information about creating a simple CSOM application in Microsoft Visual Studio, see Microsoft.ProjectServer.Client.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ProjectServer.Client;

namespace ReadProjectList
    class Program
        private const string pwaPath = "http://ServerName/PwaName/";    // Change the path for Project Web App.
        private static ProjectContext projContext;

        static void Main(string[] args)
            projContext = new ProjectContext(pwaPath); 

            // Get the list of published projects in Project Web App.

            Console.WriteLine("\nProject ID : Project name : Created date");

            foreach (PublishedProject pubProj in projContext.Projects)
                Console.WriteLine("\n\t{0}\n\t{1} : {2}", pubProj.Id.ToString(), pubProj.Name, 

            Console.Write("\nPress any key to exit: ");