次の方法で共有


New SharePoint CSOM version released for Office 365

We are happy to announce availability of new SharePoint CSOM package version for the Office 365. This release is done now using a NuGet package release. You can find the latest CSOM package for the cloud from the NuGet gallery with an id of ‘Microsoft.SharePointOnline.CSOM’. We will also update the redistributable package in upcoming weeks, but you can already right now get access on the updated CSOM for your solutions.

Notice that the version for these assemblies is 16.1.3912.1204, so that they do not overlap with the redistributable package, which will continue using 16.0.x.x style versioning. This way updated assemblies added to the NuGet packages will be used by your applications regardless if you had also installed the redistributable package. We are also planning push more frequent updates with the NuGet package in the future. When you use the NuGet package, you will always get the latest versions for you in your app. We have also included these assemblies to the assembly folder of Office 365 Developer Patterns and Practices, where you can always find latest CSOM assemblies for on-premises and cloud (currently in Dev branch and will be merged to master in May release).  We do however recommend using the nuget packages, rather than referencing these assemblies where possible.

Key updates with the assemblies

Here’s the key changes in the released assemblies. Main changes are related on level up with the on-premises CSOM which has been gradually updated during previous CUs.

  • Manage regional settings of a site
  • Manage language settings of a site
  • Manage auditing settings of a site
  • Control advance settings for document sets
  • Support for upcoming enhanced migration APIs
  • Control sandbox solution settings in site collection level
  • Secondary contact in site collection level
  • Sharing settings

We have not yet updated our Office 365 Developer Patterns and Practices samples, but the API usage is demonstrated with the samples which were originally developed for on-premises. These will be updated with the latest cloud CSOM in upcoming days now that the updated CSOM assemblies are available for broader usage.

 

How to get started with the NuGet package?

Let’s do this step by step, so that there’s no doubts.

1. Start up Visual studio and Choose the project type you want to use. In below example we will use console application.

image

2. Right click project properties and choose Manage NuGet Packages…

image

3. Search for “SharePoint Online Client Side Object Model” or “Microsoft.SharePointOnline.CSOM”

  • Notice the Created by and version information for the package.

image

4. Click Install for the package so that it will be installed on the VS project.

  • You can alternatively open up NuGet Package Manager and execute following line: “Install-Package Microsoft.SharePointOnline.CSOM -Version 16.1.3912.1204

5. Verify that the references of the project has been changed

image

6. You are ready to get started with your code. Here’s just simple code snippet to get access to Office 365, which you could add to your console application to test that everything works accordingly. You will obviously have to change the connectivity details accordingly to align with your own tenant.

 static void Main(string[] args)
 {
  
     // Get access to source site
     using (var ctx = new ClientContext("https://contoso.sharepoint.com"))
     {
         //Provide count and pwd for connecting to the source
         var passWord = new SecureString();
         foreach (char c in "mysecretpwd".ToCharArray()) passWord.AppendChar(c);
         ctx.Credentials = new SharePointOnlineCredentials("admin@contoso.onmicrosoft.com", passWord);
  
         // Actual code for operations
         Web web = ctx.Web;
         ctx.Load(web);
         ctx.ExecuteQuery();
  
         Console.WriteLine(string.Format("Connected to site with title of {0}", web.Title));
         Console.ReadLine();
     }
 }

 

Full list of changes in this release

Here’s the full list of changes in different assemblies compared to the previously released CSOM version. We will release samples in the Office 365 Developer Patterns and Practices for these gradually and are absolutely also open for contributions from the field for samples, which demonstrate these new APIs.

Those members which have existed before, but have been now changed are marked with *-character. These are the regional settings related properties which now support also updating those properties in site. We also do absolutely understand that this is not the best method or format to share the latest changes and we are working internally for better process with future releases. We did not also want to delay release notes on this, since we know that many from community have been waiting for these new APIs.

Update on 28th of April 2015 – Some of the APIs are actually meant to be used only internally and we have now marked those which we know with Internal marker.

Microsoft.SharePoint.Client

Here’s list of properties and new classes from the Microsoft.SharePoint.Client assembly.

  • public property Microsoft.SharePoint.ApplicationPages. ClientPickerQuery.ClientPeoplePickerQueryParameters.AllowOnlyEmailAddresses
  • public method Microsoft.SharePoint.Client.AppCatalog.GetAppDetails()
  • public method Microsoft.SharePoint.Client.AppCatalog.GetAppInstance()
  • public method Microsoft.SharePoint.Client.AppCatalog.GetAppPermissionDescriptions()
  • public property Microsoft.SharePoint.Client.AppInstance.ProductId    

 

  • public class Microsoft.SharePoint.Client.Audit
  • public enum Microsoft.SharePoint.Client.AuditMaskType
  • public class Microsoft.SharePoint.Client.AuditPropertyNames    

 

  • public property Microsoft.SharePoint.Client.CreatablesInfo.CanCreateFolders
  • public property Microsoft.SharePoint.Client.CreatablesInfo.CanUploadFiles
  • public class Microsoft.SharePoint.Client.DlpPolicyTip   

 

  • public method Microsoft.SharePoint.Client.File.ExecuteCobaltRequest
  • public method Microsoft.SharePoint.Client.File.GetImagePreviewUrl
  • public property Microsoft.SharePoint.Client.Folder.Exists
  • public property Microsoft.SharePoint.Client.Folder.IsWOPIEnabled
  • public property Microsoft.SharePoint.Client.Folder.ProgID    

 

  • public class Microsoft.SharePoint.Client.IngestionTaskKey    

 

  • public property Microsoft.SharePoint.Client.List.CrawlNonDefaultViews
  • public method Microsoft.SharePoint.Client.List.CreateDocumentFromTemplateStream
  • public property Microsoft.SharePoint.Client.List.FileSavePostProcessingEnabled
  • public method Microsoft.SharePoint.Client.List.GetSpecialFolderUrl
  • public method Microsoft.SharePoint.Client.List.GetWebDavUrl
  • public property Microsoft.SharePoint.Client.List.MajorVersionLimit
  • public property Microsoft.SharePoint.Client.List.MajorWithMinorVersionsLimit
  • public property Microsoft.SharePoint.Client.List.ParserDisabled
  • public property Microsoft.SharePoint.Client.ListItem.Client_Title
  • public property Microsoft.SharePoint.Client.ListItem.GetDlpPolicyTip
  • public method Microsoft.SharePoint.Client.ListItem.OverridePolicyTip    

 

  • public property Microsoft.SharePoint.Client.MountedFolderInfo.HasEditPermission
  • public property Microsoft.SharePoint.Client.MountedFolderInfo.ItemId
  • public property Microsoft.SharePoint.Client.MountedFolderInfo.ListTemplateType
  • public property Microsoft.SharePoint.Client.MountedFolderInfo.ListViewUrl
  • public property Microsoft.SharePoint.Client.MountedFolderInfo.WebUrl
  • public class Microsoft.SharePoint.Client.MoveCopyUtil  

 

  • public property Microsoft.SharePoint.Client.ObjectSharingInformation.CanBeShared
  • public property Microsoft.SharePoint.Client.ObjectSharingInformation.CanBeUnshared
  • public method Microsoft.SharePoint.Client. ObjectSharingInformation.CanCurrentUserShareRemote
  • public method Microsoft.SharePoint.Client. ObjectSharingInformation.GetObjectSharingInformationByUrl
  • public property Microsoft.SharePoint.Client. ObjectSharingInformation.SharedWithUsersCollection
  • public property Microsoft.SharePoint.Client. ObjectSharingInformationUser.IsDomainGroup
  • public class Microsoft.SharePoint.Client.ObjectSharingInformationUserCollection
  • public class Microsoft.SharePoint.Client.ObjectSharingSettings
  • public class Microsoft.SharePoint.Client.PickerSettings 

 

  • public property Microsoft.SharePoint.Client.RegionalSettings.AdjustHijriDays *
  • public property Microsoft.SharePoint.Client.RegionalSettings.AlternateCalendarType *
  • public property Microsoft.SharePoint.Client.RegionalSettings.CalendarType *
  • public property Microsoft.SharePoint.Client.RegionalSettings.CalendarType *
  • public property Microsoft.SharePoint.Client.RegionalSettings.Collation *
  • public property Microsoft.SharePoint.Client.RegionalSettings.FirstDayOfWeek *
  • public property Microsoft.SharePoint.Client.RegionalSettings.FirstWeekOfYear *
  • public property Microsoft.SharePoint.Client.RegionalSettings.LocaleId *
  • public property Microsoft.SharePoint.Client.RegionalSettings.ShowWeeks *
  • public property Microsoft.SharePoint.Client.RegionalSettings.Time24 *
  • public property Microsoft.SharePoint.Client.RegionalSettings.TimeZone *
  • public property Microsoft.SharePoint.Client.RegionalSettings.WorkDayEndHour *
  • public property Microsoft.SharePoint.Client.RegionalSettings.WorkDays *
  • public property Microsoft.SharePoint.Client.RegionalSettings.WorkDayStartHour *
  • public method Microsoft.SharePoint.Client.RegionalSettings.GetGlobalTimeZones *
  • public method Microsoft.SharePoint.Client.RegionalSettings.Update *    

 

  • public property Microsoft.SharePoint.Client.RemoteWeb.CanSendEmail
  • public method Microsoft.SharePoint.Client.RemoteWeb.GetFolderByServerRelativeUrl
  • public method Microsoft.SharePoint.Client.RemoteWeb.GetGroupById
  • public method Microsoft.SharePoint.Client.RemoteWeb.GetListByServerRelativeUrl
  • public property Microsoft.SharePoint.Client.RemoteWeb.ShareByEmailEnabled
  • public property Microsoft.SharePoint.Client.RemoteWeb.ShareByLinkEnabled

 

  • public method Microsoft.SharePoint.Client.RequestContext.GetRemoteContext
  • public property Microsoft.SharePoint.Client.RequestContext.List
  • public class Microsoft.SharePoint.Client.SharePointSharingSettings
  • public class Microsoft.SharePoint.Client.SharingResult
  • public class Microsoft.SharePoint.Client.SharingUserCollection    

 

  • public property Microsoft.SharePoint.Client.Site.Audit
  • public property Microsoft.SharePoint.Client.Site.AuditLogTrimmingRetention
  • public method Microsoft.SharePoint.Client.Site.CreateMigrationIngestionJob
  • public method Microsoft.SharePoint.Client.Site.CreateMigrationJob
  • public method Microsoft.SharePoint.Client.Site.DeleteMigrationJob
  • public method Microsoft.SharePoint.Client.Site.GetMigrationJobStatus
  • public property Microsoft.SharePoint.Client.Site.SandboxedCodeActivationCapability
  • public property Microsoft.SharePoint.Client.Site.SecondaryContact
  • public property Microsoft.SharePoint.Client.Site.TrimAuditLog    

 

  • public class Microsoft.SharePoint.Client.SPInvitationCreationResult
  • public class Microsoft.SharePoint.Client.TenantAppInstance
  • public method Microsoft.SharePoint.Client.TenantAppUtility.GetAppDetails
  • public method Microsoft.SharePoint.Client.TenantAppUtility.GetAppPermissionDescriptions
  • public method Microsoft.SharePoint.Client.TenantAppUtility.GetTenantAppInstance

 

  • public method Microsoft.SharePoint.Client.Web.AddSupportedUILanguage
  • public method Microsoft.SharePoint.Client.Web.CreateAnonymousLink
  • public method Microsoft.SharePoint.Client.Web.CreateAnonymousLinkWithExpiration
  • public method Microsoft.SharePoint.Client.Web.DeleteAllAnonymousLinksForObject
  • public method Microsoft.SharePoint.Client.Web.DeleteAnonymousLinkForObject
  • public method Microsoft.SharePoint.Client.Web.ForwardObjectLink
  • public method Microsoft.SharePoint.Client.Web.GetFileByLinkingUrl
  • public method Microsoft.SharePoint.Client.Web.GetObjectSharingSettings
  • public method Microsoft.SharePoint.Client.Web.IncrementSiteClientTag
  • public property Microsoft.SharePoint.Client.Web.IsMultilingual
  • public property Microsoft.SharePoint.Client.Web.OverwriteTranslationsOnChange
  • public method Microsoft.SharePoint.Client.Web.RemoveSupportedUILanguage
  • public method Microsoft.SharePoint.Client.Web.ShareObject
  • public property Microsoft.SharePoint.Client.Web.ThirdPartyMdmEnabled
  • public method Microsoft.SharePoint.Client.Web.UnshareObject

 

  • public property Microsoft.SharePoint.Client.Sharing.UserSharingResult.DisplayName
  • public property Microsoft.SharePoint.Client.Sharing.UserSharingResult.Email

 

  • public class Microsoft.SharePoint.Packaging.AppDetails
  • public class Microsoft.SharePoint.WebControls.ModuleLink
  • public class Microsoft.SharePoint.WebControls.ResourceManifestInformation

 

Microsoft.SharePoint.Client.Publishing

Here’s list of properties and new classes from the Microsoft.SharePoint.Client.Publishing assembly.

  • public property Microsoft.SharePoint.Client.Publishing. ImageRendition.Group

 

  • public property Microsoft.SharePoint.Client.Publishing. SpotlightChannel.TileHtmlColor
  • public property Microsoft.SharePoint.Client.Publishing. SpotlightChannel.Title
  • public property Microsoft.SharePoint.Client.Publishing. SpotlightChannel.VideoLibraryServerRelativeUrl       
  • public property Microsoft.SharePoint.Client.Publishing. SpotlightVideo.Url

 

  • public property Microsoft.SharePoint.Client.Publishing. VideoItem.OwnerName
  • public property Microsoft.SharePoint.Client.Publishing. VideoItem.PlayerPageUrl
  • public property Microsoft.SharePoint.Client.Publishing. VideoItem.Url

 

Microsoft.SharePoint.Client.Search

Here’s list of properties and new classes from the Microsoft.SharePoint.Client.Search assembly.

  • public class Microsoft.Office.Server.Search. Encryption.CertificateService - Internal       
  • public class Microsoft.SharePoint.Client.Search. Administration.PushTenantServiceInfo - Internal
  • public class Microsoft.SharePoint.Client.Search. AzureBroker.PushTenantManager - Internal
  • public class Microsoft.SharePoint.Client.Search. ContentPush.CertificateService - Internal
  • public class Microsoft.SharePoint.Client.Search. ContentPush.PushTenantManager - Internal
  • public class Microsoft.SharePoint.Client.Search. ContentPush.PushTenantServiceInfo - Internal
  • public property Microsoft.SharePoint.Client.Search. Query.KeywordQuery.TimeZoneId

 

Microsoft.SharePoint.Client.UserProfiles

Here’s list of properties and new classes from the Microsoft.SharePoint.Client.UserProfiles assembly.

  • public property Microsoft.SharePoint.Client.UserProfiles. FollowedItem.IsHybrid
  • public method Microsoft.SharePoint.Client.UserProfiles. UserProfile.CreatePersonalSiteSyncFromWorkItem

 

Microsoft.SharePoint.Client.DocumentManagement

Here’s list of properties and new classes from the Microsoft.SharePoint.Client.DocumentManagement assembly.

  • public class Microsoft.SharePoint.Client.DocumentSet.AllowedContentTypeCollection
  • public class Microsoft.SharePoint.Client.DocumentSet.DefaultDocument
  • public class Microsoft.SharePoint.Client.DocumentSet.DefaultDocumentCollection
  • public class Microsoft.SharePoint.Client.DocumentSet.DefaultDocumentPropertyNames
  • public class Microsoft.SharePoint.Client.DocumentSet.DocumentSetTemplate
  • public class Microsoft.SharePoint.Client.DocumentSet.DocumentSetTemplateObjectPropertyNames
  • public class Microsoft.SharePoint.Client.DocumentSet.SharedFieldCollection
  • public class Microsoft.SharePoint.Client.DocumentSet.WelcomePageFieldCollection

 

Microsoft.SharePoint.Client.Tenant

Here’s list of properties and new classes from the Microsoft.SharePoint.Client.Tenant assembly.

  • public class Microsoft.Online.SharePoint.SPLogger.LogExport – Internal
  • public class Microsoft.Online.SharePoint.SPLogger.LogFileInfo – Internal
  • public enum Microsoft.Online.SharePoint.TenantAdministration. SandboxedCodeActivationCapabilities
  • public property Microsoft.Online.SharePoint.TenantAdministration. SiteProperties.SandboxedCodeActivationCapability
  • public property Microsoft.Online.SharePoint.TenantAdministration. Tenant.AllowedDomainListForSyncClient
  • public property Microsoft.Online.SharePoint.TenantAdministration. Tenant.IsUnmanagedSyncClientForTenantRestricted
  • public property Microsoft.Online.SharePoint.TenantAdministration. Tenant.IsUnmanagedSyncClientRestrictionFlightEnabled
  • public property Microsoft.Online.SharePoint.TenantAdministration. Tenant.ShowAllUsersClaim
  • public property Microsoft.Online.SharePoint.TenantAdministration. Tenant.ShowEveryoneClaim
  • public property Microsoft.Online.SharePoint.TenantManagement. Office365Tenant.AllowedDomainListForSyncClient
  • public property Microsoft.Online.SharePoint.TenantManagement. Office365Tenant.IsUnmanagedSyncClientForTenantRestricted
  • public property Microsoft.Online.SharePoint.TenantManagement. Office365Tenant.IsUnmanagedSyncClientRestrictionFlightEnabled
  • public property Microsoft.Online.SharePoint.TenantManagement. Office365Tenant.ShowAllUsersClaim
  • public property Microsoft.Online.SharePoint.TenantManagement. Office365Tenant.ShowEveryoneClaim

 

You need additional APIs in CSOM?

imageIf you have any specific needs for the APIs you need, please let us know using User Voice in below address. We will address these requests and feedback where we can.

Please be patience on the requests, we will address those APIs which we can as fast as possible, but we do not have infinite resources, so we cannot provide any schedules related on the timing for addressing the feedback. Your input will be still highly appreciated and highly valuable for us to align the resources on the most needed capabilities.

 

Office 365 Developer Patterns and Practices

Office365PnPLogoRed_thumb1We will provide updated samples and scenarios based on these APIs in the Office 365 Developer Patterns and Practices guidance, which contains already more than 100 samples and solutions demonstrating different patterns and practices related on the app model development together with additional documentation related on the app model techniques.

Check the latest updates in our program from https://aka.ms/OfficeDevPnP. Please join us on sharing patterns and practices for the community for the benefit of the community.

“From the community for the community” – “Sharing is caring”

Comments

  • Anonymous
    April 10, 2015
    Thanks for the updates, nice improvement.

  • Anonymous
    April 10, 2015
    Thanks. Updates are great.

  • Anonymous
    April 11, 2015
    The comment has been removed

  • Anonymous
    April 12, 2015
    Finally! thanks for the update :-)

  • Anonymous
    April 16, 2015
    Unbelievably useful. Thanks!

  • Anonymous
    April 16, 2015
    i am trying to set RegionalSetting.TimeZone.Id or Description, but  am not able to update those value. please give solution for the same.

  • Anonymous
    April 20, 2015
    Is it possible post some sample code to manage regional setting and language on office 365?

  • Anonymous
    April 20, 2015
    Hi Samaresh, This sample shows how to do tha tin some level - github.com/.../Core.Settings.LocaleAndLanguage If you have more detailed questions, would suggest to use aka.ms/OfficeDevPnPYammer for the detailed discussion.

  • Anonymous
    April 27, 2015
    Hi Vardhaman - The LogExport class is an internal class and currently available for Dedicated SKU only. You will not be able to use for any SKUs.

  • Anonymous
    April 30, 2015
    Thanks Rakesh! I was expecting something like this to be the case.

  • Anonymous
    May 07, 2015
    Hi, Thanks for this article. With reference to this article, I tried to disable sharing on our SharePoint site. Using the MembersCanShare property of the Web, I am able to uncheck the "Allow members to share the site and individual files and folders. " in the site. But the "Allow access requests " is still checked. I tried the same using "UnShareObject" , but it throws an error "Method cannot be implemented.". Also, Microsoft.SharePoint.Client.Sharing.WebSharingManager.UpdateWebSharingInformation does not do so. The user is still able to share the site with users who are not members of the site. Kindly help !!

  • Anonymous
    May 11, 2015
    Hello, is it possible to use the MoveFolder method of the Microsoft.SharePoint.Client.MoveCopyUtil class via JSOM?  And/or are REST calls documented for moving folders? Thanks in advance!

  • Anonymous
    May 26, 2015
    Thanks a ton!

  • Anonymous
    June 21, 2015
    Thank you for the update.

  • Anonymous
    June 24, 2015
    Can you also use the nuget package for on premise development and deployments? Because I see it "overwrites" my Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime dll's in my Visual Studio project.

  • Anonymous
    July 19, 2015
    Hi Share Pointer, there's separate Nuget package for the on-premises. On-premises CSOM has not been updated to this level, so even though technically "cloud CSOM" works with on-premises, it will fail when you will try to use method or property which is not supported in the server side at on-premises.

  • Anonymous
    January 07, 2016
    Hi Vesku, Do you have any update on the issue with "Web.AddSupportedUILanguage" .  I am using 16.1.3912.1204 version and it is not working . The UI is distorted very much . Please let me know if any latest version is available with this fix .

  • Anonymous
    January 10, 2016
    Hi Vesku, I tried even with the  latest version 16.1.4727.1200 and still I am getting the issue. The language values are getting updated , but the UI is distorted after that . My site collection default language is French and I am tying to add English as secondary .

  • Anonymous
    January 10, 2016
    The comment has been removed

  • Anonymous
    January 10, 2016
    Hi Ajesh Kakkoprath, I'm not quite sure on the issue details, so could you provide more detailed scenario on this. Is this coming in the my sites or in any site? Is this coming also if you se the language setting manually or just by using code? Would also appreciate if we would have this discussion at PnP Yammer Group rather than in here, so that others can benefit from the discussion as well. PnP Yammer group is at aka.ms/OfficeDevPnPYammer. thx.

  • Anonymous
    January 10, 2016
    The comment has been removed

  • Anonymous
    January 11, 2016
    Hi Vesku, Issue happens only if I set the value through code .From UI it works fine and also it happens with template like Team site , Document management site etc.I am provisioning the site using remote provisioning and after that trying to set alternate languages . If primary language is "English" and if I add "French" as additional language it works fine . But when the primary language is "French" and then if I add "English" as additional ,then the UI is distorted in the browser with "English" as language setting.  I added the query in the yammer group as you mentioned. Thanks

  • Anonymous
    September 23, 2016
    Hi, We are trying to adding external users to SharePoint Online using this CSOM version. Basically we need to automate the process of inviting external users to our SharePoint Online site.Is it possible?Can you please share some pointers on the same.Please let me know if you need any further details.Regards,Arun