I have an ASP .Net project that targets .net 4.7.1. I'm trying to add the Microsoft.AspNetCore.DataProtection package (that depends on .net standard 2.0).
I thought .net 4.7.1 is part of the .net standard 2.0, but NuGet tells me the following when I try to add this package.
Attempting to gather dependency information for package 'Microsoft.AspNetCore.DataProtection.2.0.2' with respect to project 'IssueCenter.Website', targeting '.NETFramework,Version=v4.7.1' Gathering dependency information took 239,47 ms Attempting to resolve dependencies for package 'Microsoft.AspNetCore.DataProtection.2.0.2' with DependencyBehavior 'Lowest' Resolving dependency information took 0 ms Resolving actions to install package 'Microsoft.AspNetCore.DataProtection.2.0.2' Resolved actions to install package 'Microsoft.AspNetCore.DataProtection.2.0.2' Retrieving package 'Microsoft.AspNetCore.DataProtection 2.0.2' from 'NuGet official package source'. GET https://www.nuget.org/api/v2/package/Microsoft.AspNetCore.DataProtection/2.0.2 OK https://www.nuget.org/api/v2/package/Microsoft.AspNetCore.DataProtection/2.0.2 291ms Installing Microsoft.AspNetCore.DataProtection 2.0.2. Install failed. Rolling back... Package 'Microsoft.AspNetCore.DataProtection.2.0.2' does not exist in project 'IssueCenter.Website' Package 'Microsoft.AspNetCore.DataProtection.2.0.2' does not exist in folder 'D:\projetos\IssueCenter\DotNet\IssueCenter2.DotNet\packages' Executing nuget actions took 984,59 ms Could not install package 'Microsoft.AspNetCore.DataProtection 2.0.2'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.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. Time Elapsed: 00:00:01.4162507 ========== Finished ==========
It happens on Visual Studio 2012 and Visual Studio 2017.
Microsoft Visual Studio Community 2017 15.0.26228.4 D15RTWSVC Microsoft .NET Framework 4.7.02556 NuGet Package Manager 4.0.0
How can I add the Microsoft.AspNetCore.DataProtection package into a .net 4.7.1 project?