Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not install package 'Microsoft.Extensions.DependencyInjection.Abstractions 2.0.0

I'm attempting to use Net Core in my mvc application for security policies. Articles I've read said I need to install DependencyInjection which I'm doing through NuGet in VS 2017. I'm getting the following error:

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.5.2', but the package does not contain any assembly references or content files that are compatible with that framework.

Is this version too new for .net 4.5.2? What version should I be using?

like image 524
Robert Avatar asked Aug 24 '17 22:08

Robert


1 Answers

If you check the dependencies you can see it depends on NetStandard 2.0. From this chart you can see that you must be using at .net 4.6.1 to be compatible with NetStandard 2.0.

If you use Microsoft.Extensions.DependencyInjection.Abstractions 1.1.1 that is compatible .NETStandard 1.0 which is compatible with .NET 4.5 or newer.

like image 86
Scott Chamberlain Avatar answered Sep 28 '22 22:09

Scott Chamberlain