How to connect to SharePoint 2010 #527
-
I have internet site URL, user name and password for SharePoint 2010 on-premise. I see error: Cannot access internal method 'GetOnPremisesContext' here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
net45 project It works for net45 project netstandard2.0 project It does not work for netstandard2.0 project
|
Beta Was this translation helpful? Give feedback.
net45 project
I'm using ClientContext from assembly:
Microsoft.SharePoint.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
Assembly location:
...\.nuget\packages\microsoft.sharepointonline.csom\16.1.20122.12000\lib\net45\Microsoft.SharePoint.Client.dll
It works for net45 project
ClientContext context = new ClientContext(onpremSiteUrl);
context.Credentials = new NetworkCredential(onpremUserName, onpremUserPassword);;
context.AuthenticationMode = ClientAuthenticationMode.Default;
context.Load(context.Web);
context.ExecuteQuery();
netstandard2.0 project
I'm using ClientContext from assembly:
Microsoft.SharePoint.Client, Version=16.1.0.0, Culture=neutral, PublicKeyTo…