简体   繁体   中英

SharePoint 2013 connect 500 error

I have found code to connect SharePoint 2013 Service Pack 1:

string siteUrl = "adress";

NetworkCredential credentials = new NetworkCredential("Username", "Password");

ClientContext clientContext = new ClientContext(siteUrl);
clientContext.Credentials = credentials;
Web site = clientContext.Web;

clientContext.Load(site);
clientContext.ExecuteQuery();

Console.WriteLine("Site information: \n\n");
Console.WriteLine("Title: {0}", site.Title);
Console.WriteLine("ID: {0}", site.Id);
Console.WriteLine("Language: {0}", site.Language);
Console.WriteLine("UI Version: {0}", site.UIVersion);
Console.WriteLine("Description: {0}", site.Description);
Console.WriteLine("Created: {0}", site.Created);

Console.ReadLine();

But at the line:

clientContext.ExecuteQuery();

I get:

An unhandled exception of type 'System.Net.WebException' occurred in System.dll

Additional information: The remote server returned an error: (500) Internal Server Error.

Website works well, pass are ok, I have no (at least can't see) problems with IIS, so why I get this exception?

问题已解决,/ deafult.aspx无法解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM