SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Regex regex = new Regex(SiteUrl, RegexOptions.IgnoreCase);
  2.             string strSiteRelavtiveURL = regex.Replace(fileUrl, string.Empty);
  3.             string strServerRelativeURL = CombineUrl(web.ServerRelativeUrl, strSiteRelavtiveURL);
  4.             //web.Context.Credentials = new SharePointOnlineCredentials(UserName, GetPasswordFromConsoleInput(Password));
  5.             Microsoft.SharePoint.Client.File oFile = web.GetFileByServerRelativeUrl(strServerRelativeURL);
  6.             clientContext.Load(oFile, o => o.Title, o => o.Name, o => o.ListItemAllFields);
  7.             clientContext.ExecuteQuery();
  8.  
  9. how to resolve this issue in .net core
  10. Below error is getting
  11.  
  12. System.Net.WebException: The remote server returned an error: (400) Bad Request.
  13.    at System.Net.HttpWebRequest.GetResponse()
  14.    at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
  15.    at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
  16.    at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
  17.    at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top