question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix install for .NET 4.0

See original GitHub issue

We removed support for .NET 4.0 in v1.11 (see #696). Our intent was that projects that still targeted .NET 4.0 would continue to see and install previous package versions that supported .NET 4.0.

Unfortunately, that’s not the case. An attempt to install Google.Apis.Storage.v1 in a project targeting .NET 4.0 today results in a compatibility error:

PM> install-package google.apis.storage.v1
Attempting to gather dependencies information for package 'google.apis.storage.v1.1.11.1.434' with respect to project 'NuGetNet40', targeting '.NETFramework,Version=v4.0'
Attempting to resolve dependencies for package 'google.apis.storage.v1.1.11.1.434' with DependencyBehavior 'Lowest'
Resolving actions to install package 'google.apis.storage.v1.1.11.1.434'
Resolved actions to install package 'google.apis.storage.v1.1.11.1.434'
Adding package 'Microsoft.Bcl.Build.1.0.21' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Bcl.Build.1.0.21' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Bcl.Build.1.0.21' to 'packages.config'
Successfully installed 'Microsoft.Bcl.Build 1.0.21' to NuGetNet40
Adding package 'Microsoft.Bcl.1.1.10' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Bcl.1.1.10' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Bcl.1.1.10' to 'packages.config'
Successfully installed 'Microsoft.Bcl 1.1.10' to NuGetNet40
Adding package 'Microsoft.Bcl.Async.1.0.168' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Bcl.Async.1.0.168' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Bcl.Async.1.0.168' to 'packages.config'
Successfully installed 'Microsoft.Bcl.Async 1.0.168' to NuGetNet40
Adding package 'Microsoft.Net.Http.2.2.29' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Net.Http.2.2.29' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Microsoft.Net.Http.2.2.29' to 'packages.config'
Successfully installed 'Microsoft.Net.Http 2.2.29' to NuGetNet40
Adding package 'Newtonsoft.Json.7.0.1' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Newtonsoft.Json.7.0.1' to folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Added package 'Newtonsoft.Json.7.0.1' to 'packages.config'
Executing script file 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages\Newtonsoft.Json.7.0.1\tools\install.ps1'
Successfully installed 'Newtonsoft.Json 7.0.1' to NuGetNet40
Install failed. Rolling back...
Package 'Google.Apis.Core.1.11.1 : Microsoft.Bcl [1.1.10, ), Microsoft.Bcl.Async [1.0.168, ), Microsoft.Bcl.Build [1.0.21, ), Microsoft.Net.Http [2.2.29, ), Newtonsoft.Json [7.0.1, )' does not exist in project 'NuGetNet40'
Removed package 'Newtonsoft.Json.7.0.1 : ' from 'packages.config'
Removed package 'Microsoft.Net.Http.2.2.29 : Microsoft.Bcl [1.1.10, ), Microsoft.Bcl.Build [1.0.14, )' from 'packages.config'
Removed package 'Microsoft.Bcl.Async.1.0.168 : Microsoft.Bcl [1.1.8, )' from 'packages.config'
Removed package 'Microsoft.Bcl.1.1.10 : Microsoft.Bcl.Build [1.0.14, )' from 'packages.config'
Removed package 'Microsoft.Bcl.Build.1.0.21 : ' from 'packages.config'
Package 'Google.Apis.Core.1.11.1 : Microsoft.Bcl [1.1.10, ), Microsoft.Bcl.Async [1.0.168, ), Microsoft.Bcl.Build [1.0.21, ), Microsoft.Net.Http [2.2.29, ), Newtonsoft.Json [7.0.1, )' does not exist in folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removing package 'Newtonsoft.Json.7.0.1 : ' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removed package 'Newtonsoft.Json.7.0.1 : ' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removing package 'Microsoft.Net.Http.2.2.29 : Microsoft.Bcl [1.1.10, ), Microsoft.Bcl.Build [1.0.14, )' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removed package 'Microsoft.Net.Http.2.2.29 : Microsoft.Bcl [1.1.10, ), Microsoft.Bcl.Build [1.0.14, )' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removing package 'Microsoft.Bcl.Async.1.0.168 : Microsoft.Bcl [1.1.8, )' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removed package 'Microsoft.Bcl.Async.1.0.168 : Microsoft.Bcl [1.1.8, )' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removing package 'Microsoft.Bcl.1.1.10 : Microsoft.Bcl.Build [1.0.14, )' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removed package 'Microsoft.Bcl.1.1.10 : Microsoft.Bcl.Build [1.0.14, )' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removing package 'Microsoft.Bcl.Build.1.0.21 : ' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
Removed package 'Microsoft.Bcl.Build.1.0.21 : ' from folder 'c:\users\matthew\documents\visual studio 2015\Projects\NuGetNet40\packages'
install-package : Could not install package 'Google.Apis.Core 1.11.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the 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:1
+ install-package google.apis.storage.v1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

The best workaround at the moment is for customers to install the previous version explicitly: Install-Package Google.Apis.Storage.v1 -Version 1.10<tab> (Unfortunately NuGet also won’t do partial matching on the version.)

This isn’t acceptable and it isn’t the experience we intended to provide. We’re sorry for the break.

I still want to limit the maintenance burden of .NET 4.0 support, for the reasons I described in my comment in #696. The install experience has to work, but I’m okay with it leaving customers at v1.10.

With that in mind, some options I can think of:

  • Add corresponding .NET 4.0 projects for support and generated libraries.
  • Add .NET 4.0 projects only for generated (API-specific) libraries. Have the net40 versions depend on old versions of the support libraries.
  • Build a final version of our 1.10 libraries and package them as Google.Apis.DotNet40. Add “null” net40 support to the generated and support libraries so they’ll still install, and add net40-specific dependencies on this other library. This is a slightly more elegant version of just checking in the built binaries.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisdunelmcommented, Jun 1, 2016

Yes, good point, I’ve added a few comments on stackoverflow

0reactions
LindaLawtoncommented, Jun 1, 2016

I wonder if he is trying to add each one by itself instead of just doing

PM> Install-Package Google.Apis.Calendar.v3.

If he is actually doing

PM> Install-Package Google.Apis.Core 1.13.1

It would of course tell him that it cant do that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Net 4.0 will not load
Net framework repair tool to repair the currently installed packages and then enable the framework version 4.0. If the repair tool does not ......
Read more >
How to Fix the Microsoft .NET Framework 4 Installation ...
How to Fix the Microsoft .NET Framework 4 Installation Error "0x800c0006" on Windows · 1. Check Your Internet Connection and Test Your Wi-Fi ......
Read more >
How to install .Net v4x framework in Windows 10 when v4 ...
NET Framework 4 /4.6 on Windows 10? Still looking for new steps or a new repair tool from Microsoft to fix installation of...
Read more >
How to install .Net Framework 4 on windows 7 - YouTube
How to install . Net Framework 4 on windows 7 | . net error in windows 7 | Fix all version . net...
Read more >
NET Framework 4.0 does not install when 4.5 is already ...
NET 4.5 installed. Visual Studio 2012 Update 1 is supposed to fix this issue. You can set the .NET framework version for your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found