private static NetworkPath BuildDnsNetworkPath(string targetName, ushort replicationPort) { try { IPAddress ipaddress = NetworkManager.ChooseAddressFromDNS(targetName); if (ipaddress != null) { return new NetworkPath(targetName, ipaddress, (int)replicationPort, null) { NetworkChoiceIsMandatory = true }; } } catch (SocketException ex) { throw new NetworkTransportException(ReplayStrings.NetworkAddressResolutionFailed(targetName, ex.Message), ex); } throw new NetworkTransportException(ReplayStrings.NetworkAddressResolutionFailedNoDnsEntry(targetName)); }