这是我们的问题:如何在 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/