Sandra
Sandra

Reputation: 708

How to set up a .NET development environment for SharePoint Online

We need to migrate some things from several on-prem systems into SharePoint Online.

I'd like to use C#.NET because ideally, we would then be able to re-use code written for on-prem SharePoint.

On-prem SharePoint code I've used in the past uses references like this:

<Reference Include="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />

And connects to SharePoint like this:

// Connect to SharePoint
SPSite site = new SPSite("http://SiteURL/");
SPWeb web = site.OpenWeb();
// Connect to lists
foreach (SPList l in web.Lists)
...

We no longer have on-prem SharePoint.

What would we need to have on our dev machine so that we can use our code to access SharePoint online?

Upvotes: 0

Views: 554

Answers (1)

Baker_Kong
Baker_Kong

Reputation: 1889

SharePoint Online does not expose Server side SDK (SSOM), so you canot use above code or reference Microsoft.SharePoint. The available options for SPO connection are:

  • CSOM
  • JSOM
  • Rest API

More References:

BR

Upvotes: 2

Related Questions