我想做一个远程处理应用程序。
在我的服务器应用程序中,我添加了System.Runtime.Remoting库。在我的源代码中,我写道:
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
在我的课堂上,我写道:
HttpServerChannel channel = new HttpServerChannel(1111);
但后来我收到了错误信息:
无法找到类型或命名空间名称'HttpServerChannel‘(您是缺少使用指令还是程序集引用?)
你能告诉我如何解决这个问题吗?我想从HttpServerChannel类创建一个对象。谢谢。
发布于 2012-02-07 12:29:53
如果目标框架设置为.NET Framework4,则应检查Visual中服务器应用程序项目的设置。
如果目标框架设置为.NET Framework4ClientProfile,则将其更改为上面命名的目标框架。
客户端配置文件中的程序集不包括服务器通道。
注意:如果您刚刚开始使用.NET开发分布式应用程序,那么您应该使用(WCF),因为.NET远程处理已经被废弃。
https://stackoverflow.com/questions/9174087
复制相似问题