While running Sharepoint Client Side Scripting in Visual Studio getting error at the end of ExecuteQuery()

It throws an unhandled exception of type 'System.Net.WebException' occurred in Microsoft.SharePoint.Client.dll

Additional information: The remote server returned an error: (403) Forbidden.

How can I resolve this ?

enter image description here


2 Answers 2


You need to verify 2 things:-

  • Check whether the site you are trying to access is really exists? URL is valid?
  • The Credential you are using to authenticate must have permission to access the web which you are trying to access. Verify once by using to same credential via web browser.
  • yes am using really existing URL, I could able to log in via web browser
    – JishinK
    Dec 12, 2016 at 12:26

in app.config file add the below line worked for me:

    <defaultProxy useDefaultCredentials ="true"></defaultProxy>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.