HttpServerChannel could not be found

本文关键字:found be not could HttpServerChannel | 更新日期: 2023-09-27 18:23:49

我想制作一个远程处理应用程序。

在我的服务器应用程序上,我添加了System.Runtime.Remoting库。在我的源代码上,我写道:

using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

在课堂上,我写道:

HttpServerChannel channel = new HttpServerChannel(1111);

但后来我收到错误消息:

找不到类型或命名空间名称"HttpServerChannel"(分别为缺少using指令或程序集引用?)

你能告诉我如何解决这个问题吗?我想从HttpServerChannel类创建一个对象。谢谢

HttpServerChannel could not be found

如果目标框架设置为.NET Framework 4,则应在Visual Studio中检查服务器应用程序项目的设置。

如果目标框架设置为.NET Framework 4客户端配置文件,则将其更改为上面命名的目标框架。

客户端配置文件中的程序集不包括服务器通道。

注:如果您刚开始使用.NET开发分布式应用程序,那么您应该使用Windows Communication Foundation(WCF),因为.NET远程处理已被弃用。