В общем сам вопрос-
есть длл'ка. в ней реализован класс Remote
в нём есть метод test куда передаётся ссылка на label.... так сложно начал... ща код напишу.
public class Remote : MarshalByRefObject
{
public void test2(ref Label lb)
{
lb.Text += "\n вродь работает";
}
}
есть сервер на нём то сиё и запускается. на вск случай напишу app.config
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config -->
<configuration>
<system.runtime.remoting>
<application name="RemotingTest">
<service>
<wellknown
mode="SingleCall"
type="RemoteMethods.Remote, RemoteMethods"
objectUri="Remote.rem" />
</service>
<channels>
<channel ref="tcp" port="8008" />
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channels>
</application>
</system.runtime.remoting>
</configuration>
далее клиент
форма и сё такое описно напишу кусок
RemotingConfiguration.Configure("KickerChatClient.exe.config");
Remote remoteHost = new Remote();
remoteHost.test2(ref label1);
и собсно app.config на клиетне
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config -->
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="RemoteMethods.Remote, RemoteMethods"
url="tcp://localhost:8008/RemotingTest/Remote.rem" />
</client>
<channels>
<channel ref="tcp" port="0">
<clientProviders>
<!--formatter ref="binary" /-->
<formatter ref="binary" typeFilterLevel="Full" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
так вот сам вопрос.=)
на строке remoteHost.test2(ref label1);
выкидывает ошибку "Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed."
пробовал и так и сяк... что интересно типы int, string и т.д. он нормально их преобразует.
доскажите кто что может, как это можно перебороть.
спс.
Здравствуйте, kicker, Вы писали:
K>выкидывает ошибку "Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed."
Поиск рулит.
Вот это зачем:
ref Label lb
?
Люди добрые глубоко извиняюсь, что потревожил... я тупой...
на сервере канкалы выглядели так
<channels>
<channel ref="tcp" port="8008" />
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channels>
а нада то так=)
<channels>
<channel ref="tcp" port="8008">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
Собсно. проблема решена не окончательно..
теперь апп.конфиг на сервере выглядит так.
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config -->
<configuration>
<system.runtime.remoting>
<application name="RemotingTest">
<service>
<wellknown
mode="SingleCall"
type="RemoteMethods.Remote, RemoteMethods"
objectUri="Remote.rem" />
</service>
<channels>
<channel ref="tcp" port="8008" >
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
<clientProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
на клиентне
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config -->
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="RemoteMethods.Remote, RemoteMethods"
url="tcp://localhost:8008/RemotingTest/Remote.rem" />
</client>
<channels>
<channel ref="tcp" port="0">
<clientProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
всё отлично проходит терь лебелы и проч он понимает...
но! происходит следующая ситуация....
клиент делает вызов от remoteHost.test2(ref label1);
далее на клиенте метод выполняется, заканчивает работу, но обратно на клиент что то не передается... клиент зависает.
может и с этим кто то сталкивался?
ЗЫ поиск для этого не рулит(((