SharePoint 2013连接500错误

时间:2014-05-06 16:06:49

标签: c# sharepoint

我找到了连接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();

但在线:

clientContext.ExecuteQuery();

我明白了:

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

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

网站运行良好,通过正常,我没有(至少看不到)IIS的问题,为什么我会得到这个例外?

1 个答案:

答案 0 :(得分:0)

问题解决后,/ default.aspx无法进入地址。