Здравствуйте, я загрузил сервер asp. net core 3.1 https://networkscanner.herokuapp.com/ ping checker в Heroku, и когда я пу sh, кнопка для проверки выдает ошибку Heroku
Важно отметить, что когда сервер находится на моем локальном хосте, он в порядке
2020-04-11T12:06:01.928201+00:00 app[web.1]: ---> System.PlatformNotSupportedException: The system's ping utility could not be found.
2020-04-11T12:06:01.928202+00:00 app[web.1]: at System.Net.NetworkInformation.Ping.GetPingProcess(IPAddress address, Byte[] buffer, PingOptions options)
2020-04-11T12:06:01.928202+00:00 app[web.1]: at System.Net.NetworkInformation.Ping.SendWithPingUtility(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options)
И это мой код
async void SendPing()
{
Ping pingSender = new Ping();
int timeout = 10000;
string d = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes(d);
PingOptions options = new PingOptions(64, true);
PingReply reply = pingSender.Send(this.numbers.Address, timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
endPoint.ip = reply.Address.ToString();
endPoint.isUP = true;
endPoint.ms = reply.RoundtripTime.ToString();
result.status = 200;
result.message = "OK";
result.endPoint = endPoint;
await Clients.All.SendAsync("Send", result);
}
else
{
endPoint.ip = reply.Address.ToString();
result.message = reply.Status.ToString();
endPoint.isUP = false;
result.status = 400;
result.endPoint = endPoint;
await Clients.All.SendAsync("Send", result);
}
}
return result;