powered by simpleCommunicator - 2.0.49     © 2025 Programmizd 02
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / .NET Remoting (Security Exception)
6 сообщений из 6, страница 1 из 1
.NET Remoting (Security Exception)
    #32559228
Valeriu Vrabie
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Pocemu v clientskoi programme poeavleatiesea System.Security.SecurityException.

Type System.DelegateSerializationHolder and the types derived from it are not permitted to be deserialized at this security level ??



Ia je pod adminom u sebea na computere



Spasibo,
...
Рейтинг: 0 / 0
.NET Remoting (Security Exception)
    #32559399
Владимир Штепа
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Valeriu VrabiePocemu v clientskoi programme poeavleatiesea System.Security.SecurityException.

Type System.DelegateSerializationHolder and the types derived from it are not permitted to be deserialized at this security level ??



Ia je pod adminom u sebea na computere



Spasibo,

Вы привели очень мало информации чтобы что то толковое сказать.
...
Рейтинг: 0 / 0
.NET Remoting (Security Exception)
    #32560086
viper
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Действительно, хотелось бы по больше информации...
_________________________________________________
Легче написать не правильную программу чем понять правильную (С) Alan Perlis
...
Рейтинг: 0 / 0
.NET Remoting (Security Exception)
    #32560646
Valeriu Vrabie
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
backfire Valeriu VrabiePocemu v clientskoi programme poeavleatiesea System.Security.SecurityException.

Type System.DelegateSerializationHolder and the types derived from it are not permitted to be deserialized at this security level ??



Ia je pod adminom u sebea na computere



Spasibo,

Вы привели очень мало информации чтобы что то толковое сказать.

backfire Valeriu VrabiePocemu v clientskoi programme poeavleatiesea System.Security.SecurityException.

Type System.DelegateSerializationHolder and the types derived from it are not permitted to be deserialized at this security level ??



Ia je pod adminom u sebea na computere



Spasibo,

Вы привели очень мало информации чтобы что то толковое сказать.


Horoso! Bolee podrobno, (Vsea Programa)
Prejde cem smotreti, Mogu scazati cito rabodaiet bez "configuration files".
Ne znaiu pocemu problema v config.

Spasibo

Vot cod u clasa Server.cs
using System;
using System.Runtime.Remoting;

public class Server{
public static void Main(string[] Args){
RemotingConfiguration.Configure("Central.config");
Console.WriteLine("The host application is currently running. Press Enter to exit.");
Console.ReadLine();
}
}

Cod dlea ChatCoodinator.cs

using System;
using System.Runtime.Remoting;
using System.Collections;

// Define the class that contains the information for a Submission event.
[Serializable]
public class SubmitEventArgs : EventArgs{

private string _string = null;
private string _alias = null;

public SubmitEventArgs(string contribution, string contributor){
this._string = contribution;
this._alias = contributor;
}

public string Contribution{
get{
return _string;
}
}

public string Contributor{
get {
return _alias;
}
}
}

// The delegate declares the structure of the method that the event will call when it occurs.
// Clients implement a method with this structure, create a delegate that wraps it, and then
// pass that delegate to the event. The runtime implements events as a pair of methods,
// add_Submission and remove_Submission, and both take an instance of this type of delegate
// (which really means a reference to the method on the client that the event will call).
public delegate void SubmissionEventHandler(object sender, SubmitEventArgs submitArgs);

// Define the service.
public class ChatCoordinator : MarshalByRefObject{

public ChatCoordinator(){

Console.WriteLine("ChatCoordinator created. Instance: " + this.GetHashCode().ToString());

}

// This is to insure that when created as a Singleton, the first instance never dies,
// regardless of the time between chat users.
public override object InitializeLifetimeService(){
return null;
}

// The client will subscribe and unsubscribe to this event.
public event SubmissionEventHandler Submission;

// Method called remotely by any client. This simple chat server merely forwards
// all messages to any clients that are listening to the Submission event, including
// whoever made the contribution.
public void Submit(string contribution, string contributor){
Console.WriteLine("{0} sent: {1}.", contributor, contribution);

// Package String in SubmitEventArgs, which will be sent as an argument
// to all event "sinks", or listeners.
SubmitEventArgs e = new SubmitEventArgs(contribution, contributor);

if (Submission != null){
Console.WriteLine("Broadcasting...");
// Raise Event. This calls the remote listening method on all clients of this object.
Submission(this, e);
}
}
}


Cod dlea Client.cs


using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class ChatClient : MarshalByRefObject {

private string username = null;

public override object InitializeLifetimeService() {
return null;
}

public ChatClient(string alias){

this.username = alias;

}

public void Run(){

RemotingConfiguration.Configure("Client.config");
ChatCoordinator chatcenter = new ChatCoordinator();
chatcenter.Submission += new SubmissionEventHandler(this.SubmissionReceiver);
String keyState = "";

while (true){
Console.WriteLine("Press 0 (zero) and ENTER to Exit:\r\n");
keyState = Console.ReadLine();

if (String.Compare(keyState,"0", true) == 0)
break;
chatcenter.Submit(keyState, username);
}
chatcenter.Submission -= new SubmissionEventHandler(this.SubmissionReceiver);
}

public void SubmissionReceiver(object sender, SubmitEventArgs args){

if (String.Compare(args.Contributor, username, true) == 0){
Console.WriteLine("Your message was broadcast.");
}
else
Console.WriteLine(args.Contributor
+ " says: " + args.Contribution);
}

public static void Main(string[] Args){

if (Args.Length != 1){
Console.WriteLine("You need to type an alias.");
return;
}

ChatClient client = new ChatClient(Args[0]);
client.Run();
}
}

Cod dlea Central.config
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="Singleton"
type="ChatCoordinator, ChatCoordinator"
objectUri="Chat"
/>
</service>
<channels>
<channel
ref="http"
port="8080"
/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

Cod dlea Client.config

<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="ChatCoordinator, ChatCoordinator"
url="http://localhost:8080/Chat"
/>
</client>
<channels>
<channel
ref="http"
port="0"
/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
...
Рейтинг: 0 / 0
.NET Remoting (Security Exception)
    #32560648
Valeriu Vrabie
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
backfire Valeriu VrabiePocemu v clientskoi programme poeavleatiesea System.Security.SecurityException.

Type System.DelegateSerializationHolder and the types derived from it are not permitted to be deserialized at this security level ??



Ia je pod adminom u sebea na computere



Spasibo,

Вы привели очень мало информации чтобы что то толковое сказать.


backfire Valeriu VrabiePocemu v clientskoi programme poeavleatiesea System.Security.SecurityException.

Type System.DelegateSerializationHolder and the types derived from it are not permitted to be deserialized at this security level ??



Ia je pod adminom u sebea na computere



Spasibo,

Вы привели очень мало информации чтобы что то толковое сказать.


Horoso! Bolee podrobno, (Vsea Programa)
Prejde cem smotreti, Mogu scazati cito rabodaiet bez "configuration files".
Ne znaiu pocemu problema v config.

Spasibo

Vot cod u clasa Server.cs
using System;
using System.Runtime.Remoting;

public class Server{
public static void Main(string[] Args){
RemotingConfiguration.Configure("Central.config");
Console.WriteLine("The host application is currently running. Press Enter to exit.");
Console.ReadLine();
}
}

Cod dlea ChatCoodinator.cs

using System;
using System.Runtime.Remoting;
using System.Collections;

// Define the class that contains the information for a Submission event.
[Serializable]
public class SubmitEventArgs : EventArgs{

private string _string = null;
private string _alias = null;

public SubmitEventArgs(string contribution, string contributor){
this._string = contribution;
this._alias = contributor;
}

public string Contribution{
get{
return _string;
}
}

public string Contributor{
get {
return _alias;
}
}
}

// The delegate declares the structure of the method that the event will call when it occurs.
// Clients implement a method with this structure, create a delegate that wraps it, and then
// pass that delegate to the event. The runtime implements events as a pair of methods,
// add_Submission and remove_Submission, and both take an instance of this type of delegate
// (which really means a reference to the method on the client that the event will call).
public delegate void SubmissionEventHandler(object sender, SubmitEventArgs submitArgs);

// Define the service.
public class ChatCoordinator : MarshalByRefObject{

public ChatCoordinator(){

Console.WriteLine("ChatCoordinator created. Instance: " + this.GetHashCode().ToString());

}

// This is to insure that when created as a Singleton, the first instance never dies,
// regardless of the time between chat users.
public override object InitializeLifetimeService(){
return null;
}

// The client will subscribe and unsubscribe to this event.
public event SubmissionEventHandler Submission;

// Method called remotely by any client. This simple chat server merely forwards
// all messages to any clients that are listening to the Submission event, including
// whoever made the contribution.
public void Submit(string contribution, string contributor){
Console.WriteLine("{0} sent: {1}.", contributor, contribution);

// Package String in SubmitEventArgs, which will be sent as an argument
// to all event "sinks", or listeners.
SubmitEventArgs e = new SubmitEventArgs(contribution, contributor);

if (Submission != null){
Console.WriteLine("Broadcasting...");
// Raise Event. This calls the remote listening method on all clients of this object.
Submission(this, e);
}
}
}


Cod dlea Client.cs


using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class ChatClient : MarshalByRefObject {

private string username = null;

public override object InitializeLifetimeService() {
return null;
}

public ChatClient(string alias){

this.username = alias;

}

public void Run(){

RemotingConfiguration.Configure("Client.config");
ChatCoordinator chatcenter = new ChatCoordinator();
chatcenter.Submission += new SubmissionEventHandler(this.SubmissionReceiver);
String keyState = "";

while (true){
Console.WriteLine("Press 0 (zero) and ENTER to Exit:\r\n");
keyState = Console.ReadLine();

if (String.Compare(keyState,"0", true) == 0)
break;
chatcenter.Submit(keyState, username);
}
chatcenter.Submission -= new SubmissionEventHandler(this.SubmissionReceiver);
}

public void SubmissionReceiver(object sender, SubmitEventArgs args){

if (String.Compare(args.Contributor, username, true) == 0){
Console.WriteLine("Your message was broadcast.");
}
else
Console.WriteLine(args.Contributor
+ " says: " + args.Contribution);
}

public static void Main(string[] Args){

if (Args.Length != 1){
Console.WriteLine("You need to type an alias.");
return;
}

ChatClient client = new ChatClient(Args[0]);
client.Run();
}
}

Cod dlea Central.config
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="Singleton"
type="ChatCoordinator, ChatCoordinator"
objectUri="Chat"
/>
</service>
<channels>
<channel
ref="http"
port="8080"
/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

Cod dlea Client.config

<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="ChatCoordinator, ChatCoordinator"
url="http://localhost:8080/Chat"
/>
</client>
<channels>
<channel
ref="http"
port="0"
/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
...
Рейтинг: 0 / 0
.NET Remoting (Security Exception)
    #32560823
Владимир Штепа
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ваша проблема это FAQ.

прочтите это

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B312114

это

http://www.thinktecture.com/Resources/RemotingFAQ/Changes2003.html


и это

http://www.gotdotnet.com/team/changeinfo/Backwards1.0to1.1/default.aspx#00000153
...
Рейтинг: 0 / 0
6 сообщений из 6, страница 1 из 1
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / .NET Remoting (Security Exception)
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]