Giter Club home page Giter Club logo

project-samples's Introduction

page_type products languages extensions
sample
office-365
csharp
contentType
samples

Project CSOM Samples

Samples

Additional resources

Copyright

Copyright (c) 2016 Microsoft. All rights reserved.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

project-samples's People

Contributors

davidchesnut avatar ditiwari-0512 avatar hastalavitas avatar jboman32768 avatar lindalu-msft avatar microsoft-github-policy-service[bot] avatar nadinmerali avatar o365devx avatar robertmurugan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

project-samples's Issues

Set Baseline using Csom/PSI

Is there a way to set Baseline dates progrmatically using PSI or CSOM in Project online 365? I understand the below link says we cannot do it for Project 2013, but no such documentation is available for 365.

https://docs.microsoft.com/en-us/office/client-developer/project/what-the-psi-does-and-does-not-do#pj14_WhatPSIDoes_DoesNotDo

We were able to set the baseline using PSI by opening an instance of Winproj.exe and then calling PSI . We can still do it for 365, but just checking if there is a better way to handle it

Create Sub Projects

Hello, is there a way to create master projects and subprojects? Thank you very much!

UserPrincipal.Current.DisplayName causes invalid cast exception on login

When logging into Project Online from a WIndows 10 AzureAD joined machine UserPrincipal.Current.DisplayName produces exception

Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.

Looks like its trying to get the displayname for the user currently logged into the local computer - which in most cases is irrelevant to the login to the remote system.

Broken links in readme

These links below in the readme are broken (404)

@NadinMerali @superjijimouse is anyone still addressing issues in this repro? Are you accepting pull requests?

Regards,
Lee

Broken links:

  • CreateProject
  • UpdateProject
  • UpdateProjectCustomFields

Can't read if I have more than 20 projects

When I try to use this on a site with more than 20 projects I get an error trying to 'read' or 'manage' those projects. This is because of a hard limit in CSOM I think? Maybe you can offer a way to filter so regardless of how many I can see some.

ProjToolV2.sln doesn't build.

Looks like it's mostly missing references to the CSOM Nuget Packages.

It's also missing an icon file (Project.ico) in the solution root.

1>------ Build started: Project: ProjToolV2, Configuration: Debug Any CPU ------
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ProjectOwner.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ProjectOwner.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ProjectTeamBuilder.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ProjectTeamBuilder.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\CheckInCheckOut.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\CheckInCheckOut.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ProjectsPublish.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ProjectsPublish.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ServerObjectsDelete.cs(13,28,13,41): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ServerObjectsDelete.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Manage\ServerObjectsDelete.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\BackgroundExecutorWithStatus.cs(6,17,6,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\CustomFieldsCreation.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\LoginPage.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\LoginPage.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\LookupTablesCreation.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\ProjectsCreation.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\BaseForm.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomBase.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomBase.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\ResourcesCreation.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(6,17,6,30): error CS0234: The type or namespace name 'ProjectServer' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(7,17,7,27): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\Utils.cs(15,22,15,32): error CS0234: The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomBase.cs(19,23,19,41): error CS0246: The type or namespace name 'EnterpriseResource' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\ProjectsCreation.cs(137,24,137,53): error CS0246: The type or namespace name 'AssignmentCreationInformation' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\ProjectsCreation.cs(147,22,147,45): error CS0246: The type or namespace name 'TaskCreationInformation' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Creation\ProjectsCreation.cs(166,13,166,47): error CS0246: The type or namespace name 'ProjectResourceCreationInformation' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\BaseForm.cs(15,25,15,39): error CS0246: The type or namespace name 'ProjectContext' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(316,93,316,105): error CS0246: The type or namespace name 'ClientObject' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(338,43,338,73): error CS0246: The type or namespace name 'DraftProjectResourceCollection' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(363,38,363,63): error CS0246: The type or namespace name 'DraftAssignmentCollection' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(387,36,387,55): error CS0246: The type or namespace name 'DraftTaskCollection' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(30,17,30,33): error CS0246: The type or namespace name 'PublishedProject' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(31,29,31,37): error CS0246: The type or namespace name 'Calendar' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(32,29,32,47): error CS0246: The type or namespace name 'EnterpriseResource' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(121,67,121,79): error CS0246: The type or namespace name 'ClientObject' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Update\ProjectUpdater.cs(188,79,188,91): error CS0246: The type or namespace name 'ClientObject' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(21,23,21,41): error CS0246: The type or namespace name 'EnterpriseResource' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(39,43,39,51): error CS0246: The type or namespace name 'QueueJob' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(44,48,44,56): error CS0246: The type or namespace name 'QueueJob' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(95,52,95,60): error CS0246: The type or namespace name 'QueueJob' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(126,39,126,47): error CS0246: The type or namespace name 'QueueJob' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomHelper.cs(19,23,19,37): error CS0246: The type or namespace name 'ProjectContext' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomBase.cs(28,23,28,27): error CS0246: The type or namespace name 'User' could not be found (are you missing a using directive or an assembly reference?)
1>C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Utilities\CsomBase.cs(16,24,16,42): error CS0246: The type or namespace name 'EnterpriseResource' could not be found (are you missing a using directive or an assembly reference?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And

1>------ Build started: Project: ProjToolV2, Configuration: Debug Any CPU ------
1>CSC : error CS7064: Error opening icon file C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Project.ico -- Could not find file 'C:\projects.temp\Project-Samples\365-Project-Online-OM-ProjToolV2\ProjToolV2\Project.ico'.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Payload to Update Assignments

I am looking at submitting Assignment Updates through REST API. I know CSOM Code exists to do the same but i am looking at the REST API Payload. so far i have following APIs and payload. Which seems to give me Status Code as 200. But somehow first API is doing nothing. Can someone please verify the payload.

POST:/_api/ProjectServer/EnterpriseResources('Id')/Assignments/update()
{'Id':'39822522-b09c-e811-80c9-00155dc47e07','**remainingWork**':0 }

I am okay if i can update Percentage Update. this API seems to be working okay.because if i make changes in "My Task" and call below API. It actually submits the saved changes

POST:/_api/ProjectServer/EnterpriseResources('Id')/Assignments/submitAllStatusUpdates('Hello World')
Any help will be appreciated.

CSOMUnknownUser error on draft project

I'm using local Project Server 2013 and when I try to execute query on draft project I receive CSOMUnknownUser error.
line of code from this project that I'm getting that error are:

context.Load(draft.ProjectResources, dp => dp.Where(r => r.Name == localResourceName));       
context.ExecuteQuery();

I think I have a config problem in my Project Server

Update project description (412) Precondition Failed

Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (412) Precondition Failed."
At C:\Users\CarlosOlivares\Downloads\Project-REST-Basic-Operations-master\Project-REST-Basic-Operations-master\ReST.ps1:128 char:5

  • $resp = $request.GetResponse()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : WebException

REST - Update project description (412) Precondition Failed

Update project description not working from updateproject.ps1 for project created with createproject.ps1 - code:
$body = "{'Description':'Updated from PowerShell using REST API'}"
Patch-ReSTRequest $SiteUrl "ProjectServer/Projects('$projectid')/Draft" $body

Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (412) Precondition Failed."
At C:\vault\ps\ReST.ps1:126 char:5

  • $resp = $request.GetResponse()
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : WebException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.