使用代码开启通道,加载远程对象都没有问题,但换到配置文件中以后就不成了
错误如下:
---------------------------
System.Security.SecurityException: 不允许类型 System.DelegateSerializationHolder 和从中派生的类型(例如 System.DelegateSerializationHolder)在此安全级别上被反序列化。
---------------------------网上找到的相关解决方案如下(不能解决...):
------------------------------
http://topic.csdn.net/t/20051226/21/4482753.html
http://www.cnblogs.com/zhengyun_ustc/archive/2005/05/18/158276.html
------------------------------配置文件全部内容如下(测试用的Test对象里边什么都没做,可正常调用):
--------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.runtime.remoting>
    <application>      <channels>
        <channel ref="tcp" port="8000"/>
          <serverProviders>
              <provider ref="wsdl" />
              <formatter ref="binary" typeFilterLevel="Full" />
              <formatter ref="soap" typeFilterLevel="Full" />
          </serverProviders>
          <clientProviders>
              <formatter ref="binary" />
          </clientProviders>      </channels>      <service>
        <wellknown mode="Singleton"
                   type="My.Login, User.Login"
                   objectUri="Login" />
      </service>      <service>
        <wellknown mode="Singleton"
                   type="My.Test, User.Test"
                   objectUri="Test" />
      </service>      <lifetime leaseTime="80000M" sponsorshipTimeout="80000M" renewOnCallTime="80000M"/>     </application>
   </system.runtime.remoting>
</configuration>

解决方案 »

  1.   

    楼上的,前几天还看CSDN给你评了优秀呢,你怎么能只UP呢???
      

  2.   

    <formatter ref="binary" typeFilterLevel="Full" />
    <formatter ref="soap" typeFilterLevel="Full" />
    这个在两端都要有
      

  3.   

    http://www.cnblogs.com/wayfarer/archive/2004/07/30/28723.html
    建議樓主看看這個吧!!很不錯
      

  4.   

    很多东西都学习自楼上介绍的BLOG,确实很不错。但目前这个问题是今天换了配置文件刚刚碰到的。
      

  5.   

    看了你这个配置文件 2个字 乱七八糟
    给你看看目前我用的 客户端激活模式
    server
      <system.runtime.remoting>
        <application>
          <service>
            <activated type="ServerObject.Data.DataOperate10g, ServerObject" objectUri="DataOperate10g.soap" />
          </service>
          <channels>
            <channel ref="http" port="8888">
            </channel>
          </channels>
        </application>
      </system.runtime.remoting>
    client
      <system.runtime.remoting>
        <application>      
          <client url="http://192.168.202.198:8888">
            <activated type="ServerObject.Data.DataOperate10g, ServerObject" />
          </client>
        </application>
      </system.runtime.remoting>
      

  6.   

    你这个肯定不可以。我不用试。我现在用的是.net2.0版本。你的没有设定安全级别,我有序列化的内容,肯定过不了的。