Could not install package 'Stripe.net 39.27.0'. You are trying to install this package into a project that targets '

Viewed 1397

i am installing nuget package strip.net but when installing it give me this error in visoul studio , i did not find any solution plz need your solution

Severity Code Description Project File Line Suppression State Error Could not install package 'Stripe.net 39.27.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. For more information, contact the package author. 0

1 Answers

The problem is that the latest nuget package Stripe.net 39.27.0 does not support your old target framework version 4.5.2. It is designed by the nuget author.

enter image description here

First, see this of Stripe.net 39.27.0: The nuget package supports net framework >=4.6.1 and net standard>=2.0. Since your target framework is 4.5.2 and also net standard 2.0 does not support 4.5.2 but supports >=4.6.1,see this document, so you do not meet either of these conditions.

So the solution is to either downgrade your nuget package or upgrade the target framework version of your project.

Solution

1) downgrade your nuget package, try to install the nuget package Stripe.net 37.35.0 and it supports net framework 4.5.2.

2) upgrade your project's framework version. Right-click on your project-->Properties-->Application--> change Target Framework to 4.6.1. And then you can install the latest nuget package Stripe.net 39.27.0.

enter image description here

Related