Registering sponsor returns a security restriction exception -
12-02-2004
, 06:33 PM
I am trying to resgiter a sponsor for a singleton remote object but I get
the following Exception.I have gone through many postings but they are all
ablt CAO ,,not singleton.
***Error:
Because of security restrictions, the type System.Runtime.Remoting.ObjRef
cannot be accessed
*******
***Client-Config
<configuration>
<system.runtime.remoting>
<application name="ListClient">
<client>
<wellknown type="ListServer.CompanyList, ListServer"
url="tcp://magid1017:9000/CompanyList"/>
<wellknown type="ListServer.Count, ListServer"
url="tcp://magid1017:9000/Count"/>
</client>
<channels>
<channel ref="tcp" port="9002"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
***Server Config
<configuration>
<system.runtime.remoting>
<customErrors mode="off"/>
<application name="ListServer">
<service>
<wellknown mode="Singleton" type=
"ListServer.CompanyList,ListServer" objectUri="CompanyList"/>
<wellknown mode="Singleton" type=
"ListServer.Count,ListServer" objectUri="Count"/>
</service>
<channels>
<channel ref="tcp" port="9000"/>
</channels>
</application>
<debug loadTypes="true" />
</system.runtime.remoting>
***Client Code
mLease = (ILease)RemotingServices.GetLifetimeService(objCou nt);
mSponsor = new ClientSponsor();
mSponsor.RenewalTime = TimeSpan.FromSeconds(15);
mLease.Register(mSponsor);
Thanks for your help |