带有ASP.NET 4.5 WebForms的YouTube Api-OAuth2问题 [英] YouTube Api with ASP.NET 4.5 WebForms - OAuth2 issue

查看:41
本文介绍了带有ASP.NET 4.5 WebForms的YouTube Api-OAuth2问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我请求您提供帮助...

i beg for your help with this...

我们需要使用WebForms应用程序将视频上​​传到Youtube Channel.因此,这是我想向您展示的代码的主要内容:

We need to upload videos to Youtube Channel, with a WebForms application. So, this is the main lines of the code i d like to show you:

        var folder = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/GoogleData");
        UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
        new ClientSecrets
        {
            ClientId = ConfigInfo.YouTubeApiClient_id,
            ClientSecret = ConfigInfo.YouTubeAppClient_secret,
        },
         new[] { YouTubeService.Scope.YoutubeUpload },
         "user",
         CancellationToken.None,
        new FileDataStore(folder,true)).Result;

我的错误是:System.ComponentModel.Win32Exception:访问被拒绝.

The error i have is: System.ComponentModel.Win32Exception: Access is denied.

一些有用的其他信息:

  • 我已经在console.developers.google.com中创建了clientId和凭据作为应用程序.
  • 如果我调试应用程序,它可以在我的本地主机上正常工作,但在Arvixe共享托管服务器上则无法工作.

这是我已经尝试过的:

  • 我想到的第一件事就是对该文件夹(GoogleData)授予读/写权限,所以我做到了,但仍然是同样的错误.
  • 我还要求Arvixe支持团队授予所有人完全控制"访问该文件夹的权限(他们说他们已经做到了,但不确定)
  • 我也曾尝试删除FileDataSource参数并使用GoogleWebAuthorizationBroker.Folder,但存在相同的错误.
  • 我已经阅读了所有的Google示例和代码,但它们均用于控制台或桌面应用程序,并且我有一个带有Web服务器的Web应用程序.

拜托,您能提供给我们的任何帮助将不胜感激!再次感谢 !

Please, any help you can give us will be really appreciated ! Thanks again !

推荐答案

我最近遇到了一个与您的问题非常相似的问题,并且也托管在Arvixe上.我通过将.NET目标框架版本从4.5.2更改为4.5来修复了该问题.

I recently had a very similar issue to yours, and also hosted on Arvixe. I fixed it by changing the .NET target framework version from 4.5.2 to 4.5.

我写了一篇短文章,其中包含更多信息,并且尝试更多解决方案.我希望这会有所帮助!

I wrote a short article about it that has some more info, and more solutions to try. I hope this helps!

这篇关于带有ASP.NET 4.5 WebForms的YouTube Api-OAuth2问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆