The following code allows to discover MTU between your local machine and remote host in C#:
static int? DiscoverMtu(IPAddress address, int timeout, int ttl = 240)
{
const int icmpEchoHeaderSize = 8;
const int mtuMinSize = 60;
const int mtuMaxSize = 65500;
int mtuLowerBound = mtuMinSize, mtuUpperBound = mtuMaxSize;
var bestMtu = default(int?);
using var ping = new Ping();