我創建了示例Asp.net應用程序以獲取日曆中的所有日曆和添加事件。我的應用程序工作正常,當我使用Visual Studio運行它時,它成功加載頁面,顯示所有日曆信息,在calendar.But添加事件,當我部署在IIS上的應用程序,網頁加載從來沒有和它給出了「請求超時」 exception.Kindly幫助Google Calendar Api> IIS上的網絡超時異常
以下是代碼
private CalendarService InitGoogleService()
{
UserCredential credential;
string path = Server.MapPath("~") + @"\GCSc.json";
string credPath = Server.MapPath("~") + @"\Calendar_Data";
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets
{
ClientId = "My Client Id",`enter code here`
ClientSecret = "My Client Secret"
}, Scopes, "user", CancellationToken.None, new Google.Apis.Util.Store.FileDataStore(credPath)).Result;
CalendarService service = new CalendarService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = ApplicationName,
});
return service;
}
當您部署它時它是否請求驗證?你有什麼重定向uri設置? IIS運行的是哪個應用程序池?服務器上的credPath目錄中是否有任何內容? – DaImTo
我在過去曾多次看到過這個問題,我認爲我們認爲它的時間我們很好,我會嘗試重新創建您的問題。 – DaImTo
任何更新來解決問題? – Mudasser