i'm doing a ETL process and i need do extract a web api (Konviva) by SSIS, i only tried by the RestSharp (C#).
RestSharp but i had a error when i install him:
Could not install package 'RestSharp 106.10.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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"
Im already checked the Framework version and is the Framework 4.7
That is the script what im trying to use:
var client = new RestClient("http://xxxxxxxxxx.com/action/api/course");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "password");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);```
You need to change the .NET Framework version your Script Task is using. Double click on the task, and then hit Edit Script
. Once the script editor loads, right click on the C# file under Solution
in the Solution Explorer
pane and choose Properties
.
Then change the Target framework:
value from .NET Framework 4.5
to .NET Framework 4.7
.
Once you do that, VS should tell you it will close and reopen the script file after saving it. After the script reloads, save it again for good measure and close the script editor.