相关疑难解决方法(0)

为什么我得到System.UnauthorizedAccessException拒绝访问路径'Google.Apis.Auth'被拒绝

我已经为文件管理实现了谷歌驱动器功能,它在本地系统中运行良好,但每当我在Godaddy服务器上托管它时,它会抛出以下错误

System.UnauthorizedAccessException拒绝访问路径"Google.Apis.Auth".

以下代码我正在使用:

UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
   new ClientSecrets
   {
       ClientId = System.Configuration.ConfigurationManager.AppSettings["GDriveClientId"],//Get ClientID from web.config.
       ClientSecret = System.Configuration.ConfigurationManager.AppSettings["GDriveClientSecret"]//Get ClientSecret from web.config.
   },
   new[] { DriveService.Scope.Drive },
   System.Configuration.ConfigurationManager.AppSettings["GDriveCreatedByUser"],//Get UserName from web.config.
   CancellationToken.None).Result;

return credential;
Run Code Online (Sandbox Code Playgroud)

我正在使用VS2010,IIS 7来实现上述功能

c# asp.net iis-7 google-drive-api

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

asp.net ×1

c# ×1

google-drive-api ×1

iis-7 ×1