I am using Client Object Model to access a document library on a VM SharePoint server where I do have 'FullControl' access to a Site & Site collection.
The below code works on my SharePoint Foundation environment installed on my machine, but not on the network SharePoint Server (HTTP 500 error).
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
clientContext.Load(site);
clientContext.ExecuteQuery();
So, I have tried using
System.Net.CredentialCache cc = new System.Net.CredentialCache();
NetworkCredential nc = new NetworkCredential("uName","pwd", "domain");
Using the above code gives HTTP 401 unauthorized error.
I go to the site and see my name on the site with Full Control. How to resolve this?