如何重新编译Google Drive API sdk? [英] How to recompile Google Drive API sdk?

查看:308
本文介绍了如何重新编译Google Drive API sdk?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我们的问题:如何在dotnet中重新编译Google驱动器api sdk?
=>我们没有找到源代码。
=>在二进制包中,有一个未包含项目的源文件,我们不知道该如何处理它。



问题的原因:



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



我们正在收到如下错误:


警告10
主要引用Google.Apis.Drive.v2无法解析,因为它对框架程序集System.Runtime,Version = 1.5.11.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a有间接依赖关系,在目前的目标框架中解决。 .NETFramework,版本= V4.0\" 。要解决此问题,请移除参考Google.Apis.Drive.v2或将您的应用程序重定向到包含System.Runtime,Version = 1.5.11.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a的框架版本。 p>

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



我们不能将项目升级到Dotnet framework 4.5,因为我们只有Visual Studio 2010年,它需要几个月的测试升级到Visual Studio 2012年。



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

b $ b - 我们在哪里下载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文件并将其编译到我自己的项目中。如果我了解更多,我会编辑。


Here is our question: How can recompile Google drive api sdk in dotnet? => We didn't find the source code. => In the binary package, there a single source file not shipped with a project and we don't know what to do with it.

Reason of the question:

In dotnet, we're unable to use the latest Google Drive api dll downloaded from Google: Google.Apis.Drive.v2

We are getting compilation errors like:

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".

Cause: This is because we are in Visual Studio 2010 with dotnet framework 4.0. Apparently Google.Apis.Drive.v2 is compiled with dependencies to framework 4.5.

We cannot upgrade our project to Dotnet framework 4.5 because we have only Visual Studio 2010 and it would take months of testing upgrading to visual studio 2012.

Troubleshooting We have tried to use Binding redirection in app.config files but it's not working with Class library projects that reference assemblies that need redirection (here Google.Apis.Drive.v2). For information, binding redirection was working fine if we changed the project to console application but failed when we switched back to class library.

@Google support: - Where do we download the source code of Google Drive api dll and how do we build it? - Do you plan to ship a library for dotnet 4.0 because forcing 4.5 will block a lot of companies?

解决方案

I finally found the source code for older versions (that compiled with .NET 3.5) at: http://code.google.com/p/google-api-dotnet-client/source/browse/Services/?repo=samples&name=1.3.0-beta (Google Drive in particular - it doesn't seem to exist in the main set).

I'm having trouble interacting with the source repository with Mercurial, but I was able to directly download the CS file and compile it in my own project. I'll edit if I learn more.

这篇关于如何重新编译Google Drive API sdk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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