Save your projects in C# to Project Server\Project Online via PWA using Aspose.Tasks for .NET
Tags: msproject, pwa, csharp, asposetasks
Published: 2020-04-06 08:01:45

<h2>Introduction</h2>

Below guide explains how you can manipulate your projects from <a href="https://docs.microsoft.com/en-us/ProjectOnline/get-started-with-project-online" rel="nofollow">MS Project Online</a>&nbsp;(<a href="https://support.office.com/en-us/article/get-started-with-project-web-app-0c5b05b3-b444-438c-8b22-100d87ade40b" rel="nofollow">Project Web Application</a>) hosted by <a href="https://products.office.com/EN-us/sharepoint/collaboration" rel="nofollow">SharePoint</a>.

<h2>Background</h2>

The new <a href="https://www.nuget.org/packages/Aspose.Tasks/">Aspose.Tasks</a>&nbsp;feature uses Project Web Access (or PWA) API - the same API is used for interaction of Microsoft Project Professional desktop application and Project Online service.

<h2>Using the code</h2>

Aspose.Tasks for .NET can be added as a NuGet reference from <a href="https://www.nuget.org/packages/Aspose.Tasks/">https://www.nuget.org/packages/Aspose.Tasks/</a>

<h4>Create project in Project Online account</h4>

A project can be created in your Project Online account using the ProjectServerManager class:

{% gist https://gist.github.com/aspose-com-gists/1fbf9bb1327979165dff2d532344a1b3 file=CreateProjectOnline.cs %}

Please note that `project.Get(Prj.Guid)` and `project.Get(Prj.Name)` properties should be unique within projects in the specified Project Online account.<br>Projects created in that way can be found in the “Working” store of your Project Online account (see screenshots below). The support of "Published" store will be available in future releases.

You can find the created project and store selection option in <a href="https://products.office.com/en-us/project/project-management-software" rel="nofollow">Microsoft Project Professional</a> desktop application in “Open Enterprise Project” dialog (“File-&gt;Open-&gt;Project Web App-&gt;Browse” path):

![Open Enterprise Project 1](https://dev-to-uploads.s3.amazonaws.com/i/fqlorx7bo0dyuqdy8h1h.jpg)

![Open Enterprise Project 2](https://dev-to-uploads.s3.amazonaws.com/i/co6vn1onypkt4dy19r6s.jpg)

<h4>Modify project in Project Online account</h4>

Also, you can modify a project in your Project Online account using the following syntax:

{% gist https://gist.github.com/aspose-com-gists/1fbf9bb1327979165dff2d532344a1b3 file=ModifyProjectOnline.cs %}

<h4>Working with on-premise Project Server(2016 or 2019)</h4>

Use the following code sample to create, read and update projects in on-premise Project Server (2016 or 2019) using `ProjectServerManager` class:

{% gist https://gist.github.com/aspose-com-gists/1fbf9bb1327979165dff2d532344a1b3 file=GetFromProjectServer.cs %}

<h2>How to try</h2>

You can try part of the above mentioned features with your online projects in our free web <a href="https://products.aspose.app/tasks/downloader">Aspose.Tasks Downloader</a> app - it uses the same engine under the hood. More info can be found in <a href="https://blog.aspose.app/2020/01/28/save-your-microsoft-project-online-as-a-local-.mpp-file-using-aspose.tasks-web-application/">this blog post</a>.