Reputation: 4929
I was working on a project a few weeks back and opened up the Package Manager Console to run the command Install-Package Google.Apis.Drive.v3
. Everything seemed to go just fine and there were no issues whatsoever... But now today when I try to do it I get an error telling me that this package does not support Framework 4.0!
PM> Install-Package Google.Apis.Drive.v3
Attempting to resolve dependency 'Google.Apis (≥ 1.11.1)'.
Attempting to resolve dependency 'Google.Apis.Core (≥ 1.11.1)'.
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.1.10)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.14)'.
Attempting to resolve dependency 'Microsoft.Bcl.Async (≥ 1.0.168)'.
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.2.29)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 7.0.1)'.
Attempting to resolve dependency 'Zlib.Portable.Signed (≥ 1.11.0)'.
Attempting to resolve dependency 'Google.Apis.Auth (≥ 1.11.1)'.
Installing 'Microsoft.Net.Http 2.2.29'.
You are downloading Microsoft.Net.Http from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=329770. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Net.Http 2.2.29'.
Installing 'Newtonsoft.Json 7.0.1'.
Successfully installed 'Newtonsoft.Json 7.0.1'.
Installing 'Google.Apis.Core 1.11.1'.
Successfully installed 'Google.Apis.Core 1.11.1'.
Installing 'Zlib.Portable.Signed 1.11.0'.
You are downloading Zlib.Portable.Signed from AdvancedREI, onovotny, the license agreement to which is available at http://en.wikipedia.org/wiki/Zlib_License. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Zlib.Portable.Signed 1.11.0'.
Installing 'Google.Apis 1.11.1'.
Successfully installed 'Google.Apis 1.11.1'.
Installing 'Google.Apis.Auth 1.11.1'.
Successfully installed 'Google.Apis.Auth 1.11.1'.
Installing 'Google.Apis.Drive.v3 1.11.1.434'.
Successfully installed 'Google.Apis.Drive.v3 1.11.1.434'.
Adding 'Microsoft.Net.Http 2.2.29' to Drilyser.
Successfully added 'Microsoft.Net.Http 2.2.29' to Drilyser.
Adding 'Newtonsoft.Json 7.0.1' to Drilyser.
Successfully added 'Newtonsoft.Json 7.0.1' to Drilyser.
Adding 'Google.Apis.Core 1.11.1' to Drilyser.
Uninstalling 'Google.Apis.Core 1.11.1'.
Successfully uninstalled 'Google.Apis.Core 1.11.1'.
Uninstalling 'Newtonsoft.Json 7.0.1'.
Successfully uninstalled 'Newtonsoft.Json 7.0.1'.
Uninstalling 'Microsoft.Net.Http 2.2.29'.
Successfully uninstalled 'Microsoft.Net.Http 2.2.29'.
Install failed. Rolling back...
Install-Package : Could not install package 'Google.Apis.Core 1.11.1'. You are trying t
o install this package into a project that targets '.NETFramework,Version=v4.0', but th
e package does not contain any assembly references or content files that are compatible
with that framework. For more information, contact the package author.
At line:1 char:16
+ Install-Package <<<< Google.Apis.Drive.v3
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationExc
eption
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.
InstallPackageCommand
I develop in VS2010 and use Framework 4.0. So I need this package to install in my environment. Did they maybe change the package to only support 4.5+ in a version released within the last few weeks or something? Any ideas how I can get around this?
My goal is to access the Google Drive APIs and be able to follow the example located here.
Upvotes: 1
Views: 5984
Reputation: 116918
As March 22 2016 release v1.11 of the Google .Net client library support for .Net Framework 4.0 has been discontinued (see #696).
There is currently an issue with the Nuget Get packages with regard to trying to install them on .Net 4.0 projects it should download the old no longer supported or developed upon packages. It is not working the work around would be to download the previous v1.10 version yourself. (Link)
Or you can upgrade your project to .net framework 4.5 and use the supported portion of the library.
Update:
If you choose to continue to use the .Net 4.0 version of the library be aware that there will be no further updates. This is not just in the core library but also all of the generated API libraries. If the API you are using release or changes anything you will not get any of these changes.
Install-Package Google.Apis.Drive.v3 -Version 1.10.0.130
Upvotes: 2
Reputation: 1248
See: https://www.nuget.org/packages/Google.Apis/ . Supported platform is specified as .Net Framework 4.5
Latest version of the Drive API.v3
only supports .Net Framework 4.5
.
If you really need to use it in .Net Framework 4.0
, then i suggest you install a previous version of the package.
Google.Apis.Drive.v3 Client Library 1.10.0.130
seems to support both .Net 4.0
and .Net 4.5
.
Use this command to install this specific version
Install-Package Google.Apis.Drive.v3 -Version 1.10.0.130
If this version didn't work, then try previous versions. Hope this helps.
Upvotes: 3
Reputation: 3365
I think you are talking about this package: Google.Apis.drive.v3 As you can see, it supports the following platforms:
**Supported Platforms:**
- .NET Framework 4.5
- Windows Store apps
- Windows Phone 8 and 8.1
- Portable Class Libraries
so it wont support 4.0, please upgrade it.
Upvotes: 0