Click here to Skip to main content
15,902,842 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hash Code calculation Pin
Stanciu Vlad22-Nov-05 6:08
Stanciu Vlad22-Nov-05 6:08 
GeneralRe: Hash Code calculation Pin
J4amieC22-Nov-05 6:23
J4amieC22-Nov-05 6:23 
GeneralRe: Hash Code calculation Pin
Stanciu Vlad22-Nov-05 7:40
Stanciu Vlad22-Nov-05 7:40 
GeneralRe: Hash Code calculation Pin
Leslie Sanford22-Nov-05 9:57
Leslie Sanford22-Nov-05 9:57 
Questionapplication version (major and minor) c# winform Pin
fady_sayegh22-Nov-05 2:34
fady_sayegh22-Nov-05 2:34 
AnswerRe: application version (major and minor) c# winform Pin
Dan Neely22-Nov-05 3:06
Dan Neely22-Nov-05 3:06 
AnswerRe: application version (major and minor) c# winform Pin
J4amieC22-Nov-05 3:17
J4amieC22-Nov-05 3:17 
Question.NET 1.x remoting hell! Pin
Bob Stanneveld22-Nov-05 2:32
Bob Stanneveld22-Nov-05 2:32 
Hello,

I've got a very big problem with the .NET remoting. I've developed a synchronization library using .NET 2.0 that uses classes derived from MarshalByRefObject. These classes have public events which remote objects can subscribe to. Under the 2.0 framework, everything works like a charm.

Now I have to port the library to .NET 1.x since my teachers want to be able to test and compile the code by themselves. I though that this would be a task of a few minutes. I guessed wrong. The runtime refuses to serialize the delegates. I've read something about RemotingSurrogateSelector, but I can't find a thorough explanation about how the class should be used to handle this type of serialization.

Does anybody know how I can subscribe to a remote event?

Source example:
// The delegate
public delegate void MyDelegate();
// The remote (server) object
class RemoteObject : System.MarshalByRefObject
{
    // code...
    
    public event MyDelegate EvMyEvent;
}

// The client object
class MyClient
{
    // code...
    
    private void MyDelegateFunction()
    {
    }
    
    public MyClient()
    {
        RemoteObject oRO = null;
        // Get the remote object
        oRO.EvMyEvent += new MyDelegate(MyDelegateFunction); // Exception:
        /*
             An unhandled exception of
             type 'System.Runtime.Serialization.SerializationException' occurred in 
             mscorlib.dll
    
             Additional information: Serialization will not deserialize delegates 
             to non-public methods.
        */
    }
}


Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
AnswerRe: .NET 1.x remoting hell! Pin
S. Senthil Kumar22-Nov-05 3:56
S. Senthil Kumar22-Nov-05 3:56 
GeneralRe: .NET 1.x remoting hell! Pin
Bob Stanneveld22-Nov-05 22:43
Bob Stanneveld22-Nov-05 22:43 
QuestionEval equivalent in C# Pin
zaboboa22-Nov-05 2:11
zaboboa22-Nov-05 2:11 
AnswerRe: Eval equivalent in C# Pin
Joshua Quick22-Nov-05 7:41
Joshua Quick22-Nov-05 7:41 
QuestionListen to serial port and read RFID kit Pin
Tyler4522-Nov-05 2:08
Tyler4522-Nov-05 2:08 
Questiondwg files to emf format Pin
theladsmith22-Nov-05 1:59
theladsmith22-Nov-05 1:59 
QuestionTips on how to handle Source Contol Pin
anderslundsgard21-Nov-05 23:21
anderslundsgard21-Nov-05 23:21 
AnswerRe: Tips on how to handle Source Contol Pin
mav.northwind22-Nov-05 2:00
mav.northwind22-Nov-05 2:00 
GeneralRe: Tips on how to handle Source Contol Pin
anderslundsgard24-Nov-05 4:36
anderslundsgard24-Nov-05 4:36 
GeneralRe: Tips on how to handle Source Contol Pin
mav.northwind24-Nov-05 7:44
mav.northwind24-Nov-05 7:44 
GeneralRe: Tips on how to handle Source Contol Pin
anderslundsgard24-Nov-05 23:28
anderslundsgard24-Nov-05 23:28 
QuestionProblem in running addins Pin
nbobby21-Nov-05 23:04
nbobby21-Nov-05 23:04 
AnswerRe: Problem in running addins Pin
S. Senthil Kumar22-Nov-05 4:00
S. Senthil Kumar22-Nov-05 4:00 
QuestionHow to get Controll Names used in Form? Pin
majidbhutta21-Nov-05 19:51
majidbhutta21-Nov-05 19:51 
AnswerRe: How to get Controll Names used in Form? Pin
Madhawa21-Nov-05 21:02
Madhawa21-Nov-05 21:02 
GeneralRe: How to get Controll Names used in Form? Pin
J4amieC21-Nov-05 22:18
J4amieC21-Nov-05 22:18 
AnswerRe: How to get Controll Names used in Form? Pin
J4amieC21-Nov-05 23:17
J4amieC21-Nov-05 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.