C#with Google API身份验证错误:访问路径';Google.api.Auth';否认
嗨,我正试图使用v3 api和C#在youtube上上传视频。我收到错误“访问路径'Google.api.Auth'被拒绝” 下面是我的代码C#with Google API身份验证错误:访问路径';Google.api.Auth';否认,c#,asp.net,asp.net-mvc,youtube-api,C#,Asp.net,Asp.net Mvc,Youtube Api,嗨,我正试图使用v3 api和C#在youtube上上传视频。我收到错误“访问路径'Google.api.Auth'被拒绝” 下面是我的代码 var client_secretspath = Server.MapPath("/App_Data/client_secrets.json"); using (var stream = new FileStream(client_secretspath, FileMode.Open, FileAccess.Read))
var client_secretspath = Server.MapPath("/App_Data/client_secrets.json");
using (var stream = new FileStream(client_secretspath, FileMode.Open, FileAccess.Read))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
new[] { YouTubeService.Scope.YoutubeUpload },
"user",
CancellationToken.None
);
}
此代码在本地服务器上正常工作,但当我尝试在服务器上上载时,它不工作。
我设置了IIS的完全权限。还要检查以更改json文件的物理位置,但仍然存在此问题
谢谢可能重复的我已经设置了完全权限您是否尝试提供我通常提供的完整路径。“c:\App\u Data\client\u secrets.json”是的,我尝试过,但仍然没有成功