Home: Microsoft.Extensions.logging does not install on ASp MVC 5, .Net 4.6

Created on 19 Oct 2017  路  7Comments  路  Source: NuGet/Home

I am trying to install Microsoft.Extensions.logging Nuget on my ASP.Net MVC, .net 4.6, project and it fails...

I have seen a quite a bit of discussion on git about this issue, but could not find any solution... or workaround. Is Microsoft.Extensions.Logging compatible with .net 4.5? Or is this a bug?

Appreciate a work around...

This is what I get what I install: Microsoft.Extensions.DependencyInjection.Abstractions... Microsoft.Extensions.DependencyInjection.Abstractions has a dependency on this package.

PM> Install-Package Microsoft.Extensions.DependencyInjection.Abstractions -Version 2.0.0

Attempting to gather dependency information for package 'Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0' with respect to project 'shopless.domain.classes', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 263.92 ms
Attempting to resolve dependencies for package 'Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0'
Resolved actions to install package 'Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0'
Retrieving package 'Microsoft.Extensions.DependencyInjection.Abstractions 2.0.0' from 'nuget.org'.
Install failed. Rolling back...
Package 'Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0' does not exist in project 'shopless.domain.classes'
Package 'Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0' does not exist in folder 'C:\Git\shopless\packages'
Executing nuget actions took 652.02 ms
Install-Package : Could not install package 'Microsoft.Extensions.DependencyInjection.Abstractions 2.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', 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 Microsoft.Extensions.DependencyInjection.Abstractions ...
  • ~~~~~~~~~~~~~~~~~

    • CategoryInfo : NotSpecified: (:) [Install-Package], Exception

    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:01.0190038

Thanks in advance

Question

Most helpful comment

All 7 comments

Microsoft.Extensions.DependencyInjection.Abstractions contains only lib/netstandard2.0/, this is compatible with net461 however you will need at least version 4.3.0 of nuget to get support for netstandard2.0.

Hi, Thanks a lot... so I need to update my nuget, in order to be able to install Microsoft.Extensions.Logging?

So, Microsoft.Extensions.DependencyInjection.Abstractions is the dependant package which is causing problem....

So looks like VS Studio 2015 comes with an older version of Nuget... so if I upgrade to VS 2017 which comes with Nuget 4.x, then I should be able to install it?

Thanks a lot @emgarten

So I upgraded to visual Studio 2017... at first it failed... Then I realized that if I am using .Net Framework, It has to be .Net 4.6.1 and above... after changing my .Net Framework, finally I could install it.

I had the same problem with .NET 4.7.2 and 4.6.1 and VS2015. They were complaining when I tried to install Sentry 1.0.1-beta and it looks like installing 3.6.0 nuget worked perfectly. It also required me to install dotnet-standard-support-vs2015-2.0.0-win-x86 for anyone looking. Thank you!

Was this page helpful?
0 / 5 - 0 ratings