i created Console Application in C# and in that i'm calling some external API using HTTPClient which is working fine in Windows server but the same is not working with Linux server.
Please find the below code
static void Main(string[] args)
{
HttpResponseMessage httpResponseMessage = null;
string contents = string.Empty;
using (var httpClient = new HttpClient())
{
httpResponseMessage = httpClient.GetAsync("example.com").Result;
contents = httpResponseMessage.Content.ReadAsStringAsync().Result;
}
Console.WriteLine(contents);
Console.ReadKey();
}
Need help in executing file in linux i also tried simple hello world and it is working fine.