1
votes

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
If the package cannot target .NET 4.5.2, you cannot use that package. Have you considered using a newer .NET Framework instead?Lasse V. Karlsen
If it is this package, then the minimum supported .NET Framework version is 4.6.1.Lasse V. Karlsen
Last version that supports .NET 4.5.1 is 37.35.0. I don't know what the updates give you so maybe try this older version instead?Lasse V. Karlsen
@LasseV.Karlsen could you plzz tell me how to update .netframework into newer versionFurqan Shaheen
@LasseV.Karlsen i add with stripe version 37.0.0 so is there any issue to using old version of stripe as i am working in stripe payment gateway because i successfully install the old version of stripeFurqan Shaheen

1 Answers

1
votes

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