日期:2014-05-20  浏览次数:20938 次

大家给看看这个Remoting的配置文件
使用代码开启通道,加载远程对象都没有问题,但换到配置文件中以后就不成了
错误如下:
---------------------------
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>