installing ASP.NET Identity Core 2.1.0, "You are trying to install this package into a project that targets '.NETFramework,Version=v4.6'...

Darin Rodberg 1 Reputation point
2021-12-09T21:03:29.917+00:00

Hi all,

I'm running into this error, and I can't find any solution. I need this package to work with some legacy code, but I can't seem to install it through the nuget package manage in my IDE (VS2015).

I've tried targeting different frameworks, and have systemically gone through them all, as well as trying different versions of the package. Without fail, it tells me that every single combination is not viable, including combinations which others confirmed as working, such as Identity Core 2.2.0 and .NET Framework 4.5, as per error-on-installing-microsoft-asp-net-identity-core-2-2-0

For clarity's sake, this is an asp.net web application which I created by decompiling code from the existing site using Reflector, and then starting a new Web Application and including that source code. I've corrected a lot of errors, but haven't been able to find a solution for this one.

Developer technologies | ASP.NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2021-12-10T16:27:30.6+00:00

    The error says your project is net 4.6. You can not use any .net core only nuget packages with it. You can update you project to .net core, which will probably require more code modifications, or pick 4.6 compatible nuget package. There is an owin based identity for 4.6

    https://learn.microsoft.com/en-us/aspnet/identity/overview/getting-started/introduction-to-aspnet-identity

    Note, I’d probable upgrade the project to 4.8, the final release of the 4.* framework.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.