2014-05-06 36 views
0

我發現代碼連接的SharePoint 2013的Service Pack 1:的SharePoint 2013連接500錯誤

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的問題,所以爲什麼我得到這個異常?

+0

該異常是否包含內部異常?作爲你展示的代碼,它應該沒問題。錯誤應該在服務器中。 – Matt

+0

無法看到anny內部異常,我可以補充說,這個SharePoint是在另一個服務器上,它慢了很多,這個異常是否可以在超時? – Carlos28

+0

如果超時,你會得到一個超時例外 – Matt

回答

0

問題解決了,/deafult.aspx不能在地址中。

相關問題