visual-studio - 如何重新编译 Google Drive API sdk?

标签 visual-studio google-drive-api assemblies

这是我们的问题:如何在 dotnet 中重新编译 Google drive api sdk?
=> 我们没有找到源代码。
=> 在二进制包中,有一个没有随项目一起提供的源文件,我们不知道如何处理它。

问题原因:

在 dotnet 中,我们无法使用从 Google 下载的最新 Google Drive api dll:Google.Apis.Drive.v2

我们收到如下编译错误:

Warning 10 The primary reference "Google.Apis.Drive.v2" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Google.Apis.Drive.v2" or retarget your application to a framework version which contains "System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".



原因:
这是因为我们使用的是带有 dotnet framework 4.0 的 Visual Studio 2010。
显然 Google.Apis.Drive.v2 编译时依赖于框架 4.5。

我们无法将项目升级到 Dotnet 框架 4.5,因为我们只有 Visual Studio 2010,升级到 Visual Studio 2012 需要几个月的测试。

疑难解答
我们尝试在 app.config 文件中使用绑定(bind)重定向,但它不适用于引用需要重定向的程序集的类库项目(此处为 Google.Apis.Drive.v2)。
有关信息,如果我们将项目更改为控制台应用程序,绑定(bind)重定向工作正常,但当我们切换回类库时失败。

@谷歌支持:
- 我们在哪里下载 Google Drive api dll 的源代码以及如何构建它?
- 你是否打算为 dotnet 4.0 提供一个库,因为强制 4.5 会阻止很多公司?

最佳答案

我终于在以下位置找到了旧版本(使用 .NET 3.5 编译的)的源代码:http://code.google.com/p/google-api-dotnet-client/source/browse/Services/?repo=samples&name=1.3.0-beta (特别是 Google Drive - 它似乎不存在于主集中)。

我在使用 Mercurial 与源存储库交互时遇到问题,但我能够直接下载 CS 文件并在我自己的项目中编译它。如果我了解更多,我会编辑。

关于visual-studio - 如何重新编译 Google Drive API sdk?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17831223/

相关文章:

c# - 在应用程序设置中存储带值的字符串数组

visual-studio - 继续安装 Visual Studio 2015 功能

JavaScript 从 Google Drive 或 Dropbox 上的 txt 文件中读取所有文本

google-drive-api - Drive API Children.list q 参数损坏

.net - 将未使用的默认程序集留在引用文件夹中不好?

.net - 可以清除或禁用 .NET MethodInfo 缓存吗?

c# - 如何将参数作为反射传递/传出? - visual studio 可扩展性 c#

c++ - 如何在 Visual Studio 2010 Ultimate 中创建 C++ 项目

javascript - Google Drive 的文件夹结构是否可能包含循环?

.net - 在构建时注入(inject)程序集版本号