繁体   English   中英

WCF 客户端在将 web 应用程序升级到核心 3.0 后无法工作

[英]WCF client doesn't work after upgrade web application to core 3.0

有人可以解释为什么 WCF 客户端在将 web 应用程序项目升级到 3.0 或 3.1 后无法工作。 我在 Visual Studio 创建的三个简单项目上进行了测试:新项目 => asp.net 核心 MVC 应用程序。 对项目的样板代码进行了测试修改:

public class HomeController : Controller
{
    private readonly WCFGetClient _getClient;

    public HomeController()
    {
        _getClient = new WCFGetClient();            
    }

    //some boiler plate code code
    
    public async Task<IActionResult> Privacy()
    {
        _ = await _getClient.GetAsync("some info", false);
        return View();
    }

在为核心 2.2 构建的调试模式项目中,从 WCF 服务 (.net 4.7.2) 获得响应。 但另外两个项目(3.0 和 3.1)出现异常:

SocketException:已建立的连接被主机中的软件中止。

IOException:无法从传输连接读取数据:已建立的连接被主机中的软件中止.. System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable+ConfiguredValueTaskAwaiter.GetResult()

WCF 托管在 windows 服务器 2012R2 IIS 6.2 上。

我尝试将库 System.ServiceModel.Duplex、System.ServiceModel.Federation、System.ServiceModel.Http、System.ServiceModel.NetTcp、System.ServiceModel.Primitives、System.ServiceModel.Security 更新到 4.10.0没有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM