I have changed code and it's working fine, TLS issue.
public T GetConfig<T>(string url)
{
using (WebClient webClient = new WebClient())
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var data = webClient.DownloadString(url);
var xmlSerializer = new XmlSerializer(typeof(T));
using (var reader = new StringReader(data))
{
return (T)xmlSerializer.Deserialize(reader);
}
}
}
I have changed code and it's working fine, TLS issue.