none
When I tried to update sharepoint 2013 online list from .net code then i got error. RRS feed

  • Question

  • Exception in sharepoint update   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
       at System.Net.HttpWebRequest.GetRequestStream()
       at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.DoPost(String url, String contentType, String body, Func`2 webExceptionHandler)
       at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetUserRealm(String login)
       at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy)
       at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password)
       at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh)
       at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context, HttpWebRequest request)
       at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()
       at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
       at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
       at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
       at PV_Workflow_WebAPI_2.UpdateSharePointList.updateData(String GUID, String packagename, String status) in c:\WebAPI_2\UpdateSharePointList.cs:line 43 message The remote name could not be resolved: 'login.microsoftonline.com'

    no issue with credential and working fine. 

    Please help me out into this asap.

       
    Monday, November 27, 2017 6:04 AM

All replies

  • does your server have a good network state?

    Justin Liu Office Servers and Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.


    Monday, November 27, 2017 6:44 AM
  • can you please share the code snippet.

    Thanks.... ________________ Baba (MCTS, MCPD)

    Monday, November 27, 2017 6:56 AM
  • Hi,

    To update SharePoint Online list, the following code for your reference:

    string targetSiteURL = @"https://xxx.sharepoint.com/sites/dennis";
    
    var login = "dennis@xxx.onmicrosoft.com";
    var password = "xxx";
    
    var securePassword = new SecureString();
    
    foreach (char c in password)
    {
    	securePassword.AppendChar(c);
    }
    SharePointOnlineCredentials onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
    
    ClientContext ctx = new ClientContext(targetSiteURL);
    ctx.Credentials = onlineCredentials;
    
    List oList = ctx.Web.Lists.GetByTitle("ListA");
    oList.Description = "Dennis Test";
    oList.Update();
    ctx.ExecuteQuery();

    Or you can provide the complete code in use if possible, which should make the issue easier to be researched.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, November 27, 2017 8:50 AM
    Moderator