我们从 windows server 2012 升级到 windows server 2019。我在用户会话期间使用 webclient 下载图像。当我运行它时,它可以完美地工作并在本地工作。当我将源代码移动到 Windows Server 2019 时,它因标准而失败底层连接已关闭:
使用 .Net 4.6 使用安全协议 Tls12。我对导致问题的原因感到非常困惑
ServicePointManager.Expect100Continue = false;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
using (var web_client = new WebClient())
{
web_client.DownloadFile(file_url, download_file_path_with_name);
}
有没有人有一些其他的建议。我尝试使用 Exter100Continue = true 得到相同的结果。