我创建了示例Asp.net应用程序以获取所有日历并在日历中添加事件。我使用Visual Studio运行它时应用程序工作正常它成功加载页面,显示所有日历信息,在日历中添加事件。但是,当我在IIS上部署应用程序时,页面永远不会加载,它会使"请求超时" exception.Kindly help
以下是代码
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;
}