这是微软“QuickStart”中的例程,直接运行也会报错。

解决方案 »

  1.   

    sorry,不会,帮你顶吧,没做过这方面的呢,我也是一个小菜,呵呵
      

  2.   

    从 .NET Framework 1.1 版开始,远程处理基础结构不会自动对服务器上的某些类型进行反序列化。例如,若要获取对作为参数传递的 MBR 对象的支持,必须将服务器的反序列化级别设置为 Full,然后服务器才能反序列化并使用 MBR 参数。有关此方案以及其他方案的详细信息,请参见 .NET 远程处理中的自动反序列化。依赖于运行时类型验证的远程处理系统必须反序列化一个远程流,然后才能开始使用它,未经授权的客户端可能会试图利用反序列化这一时机。为了免受这种攻击,.NET 远程处理提供了两个自动反序列化级别:Low 和 Full。Low(默认值)防止反序列化攻击的方式是,在反序列化时,只处理与最基本的远程处理功能关联的类型,如自动反序列化远程处理基础结构类型、有限的系统实现类型集和基本的自定义类型集。Full 反序列化级别支持远程处理在所有情况下支持的所有自动反序列化类型。
    原来如此!
    以下示例说明如何在宿主应用程序域中将反序列化级别设置为 Full。[C#]// Creating a custom formatter for a TcpChannel sink chain.BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();provider.TypeFilterLevel = TypeFilterLevel.Full;// Creating the IDictionary to set the port on the channel instance.IDictionary props = new Hashtable();props["port"] = 8085;// Pass the properties for the port setting and the server provider in the server chain argument. (Client remains null here.)TcpChannel chan = new TcpChannel(props, null, provider);