I'm attempting to write a console application to connect to one of our sharepoint application sites. I'm running a basic example to ensure connectivity. The program keeps failing with the following error: The remote server returned an error: (500) Internal Server Error.
Status: System.Net.WebExceptionStatus.ProtocolError
I don't have access to the IIS server to check the logs. My code is as follows:
string siteUrl = "http://spsiteurl/";
ClientContext clientContext = new ClientContext(siteUrl);
clientContext.AuthenticationMode = ClientAuthenticationMode.Default;
clientContext.Credentials = new NetworkCredential("...", "...", "...");
Web oWebsite = clientContext.Web;
clientContext.Load(oWebsite,
w => w.Title);
clientContext.ExecuteQuery();
Console.WriteLine(oWebsite.Title);
Any direction on where I could be going wrong?