Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
GeneralRe: remoting/serialization problem Pin
Heath Stewart25-Feb-04 5:01
protectorHeath Stewart25-Feb-04 5:01 
GeneralRe: remoting/serialization problem Pin
occcy25-Feb-04 20:39
occcy25-Feb-04 20:39 
GeneralRe: remoting/serialization problem Pin
Heath Stewart26-Feb-04 2:58
protectorHeath Stewart26-Feb-04 2:58 
GeneralRe: remoting/serialization problem Pin
occcy26-Feb-04 3:11
occcy26-Feb-04 3:11 
GeneralRe: remoting/serialization problem Pin
Heath Stewart26-Feb-04 3:31
protectorHeath Stewart26-Feb-04 3:31 
GeneralRe: remoting/serialization problem Pin
occcy26-Feb-04 4:19
occcy26-Feb-04 4:19 
GeneralRe: remoting/serialization problem Pin
Heath Stewart26-Feb-04 4:34
protectorHeath Stewart26-Feb-04 4:34 
GeneralRe: remoting/serialization problem Pin
Tom Larsen26-Feb-04 5:07
Tom Larsen26-Feb-04 5:07 
One thing that worries me from inspecting this code snip is that you might be mixing your client and server types.

You register ObjectType as your remoted object but then use another object ServerObject on the server. The object being remoted must be the same or implement the same interface. This is important because even if ObjectType is derived from ServerType the Remoting Framework only has registered/recognizes ObjectType as remotable. ServerType is just another type it will handle outside of the Remoting Framework. Both the client and server parts need to be dealing with the same object or deal with an interface or you get the wrong behavior.

Next once you seem to be using RemotingServices.Marshal in the wrong context. Marshal is used to transfer a MarshalByRefObject across application domains which has little to do with actually "publishing" the service.

What I recommend doing is using configuration files on both the client and the server and using RemotingConfiguration.Configure.

The client config file from your code snip should look something like this:

<configuration>
   <system.runtime.remoting>
      <application>
         <client url="tcp://server:10000">
            <wellknown
               type = "ObjectType,ObjectAssembly"
               url = "tcp://server:10000/server.rem" />
            <!-- or atlernatively, the client activated version
            <activated type="ObjectType,ObjectAssembly" />
            -->
         </client>
         <channels>
            <channel ref="tcp" port="10000" />
         </channels>
      </application>
   </system.runtime.remoting>
</configuration>


Your server config file should look something like this:

<configuration>
   <system.runtime.remoting>
      <application>
         <service>
           <wellknown mode="SingleCall" type="ObjectType, ObjectAssembly" objectUri="server.rem" />
           <!-- alternatively, the client activated version
           <activated type="ObjectType, ObjectAssembly" />
           -->
         </service>
         <channels>
            <channel ref="tcp" port="10000" />
         </channels>
      </application>
   </system.runtime.remoting>
</configuration>


If you use config files you don't have to worry about setup or teardown of channels or the registering or unregistering of types. It also makes for easy debugging since you only need to change the config file and run again instead of changing code, compile and run again.
GeneralRe: remoting/serialization problem Pin
occcy26-Feb-04 20:36
occcy26-Feb-04 20:36 
GeneralRe: remoting/serialization problem Pin
occcy26-Feb-04 4:31
occcy26-Feb-04 4:31 
Generalspider Pin
slah24-Feb-04 22:32
slah24-Feb-04 22:32 
GeneralHelp with event hiding in derived class Pin
gkrish524-Feb-04 20:40
gkrish524-Feb-04 20:40 
GeneralRe: Help with event hiding in derived class Pin
Heath Stewart25-Feb-04 4:50
protectorHeath Stewart25-Feb-04 4:50 
GeneralRe: Help with event hiding in derived class Pin
gkrish525-Feb-04 7:01
gkrish525-Feb-04 7:01 
GeneralRe: Help with event hiding in derived class Pin
Heath Stewart25-Feb-04 7:27
protectorHeath Stewart25-Feb-04 7:27 
GeneralRe: Help with event hiding in derived class Pin
gkrish525-Feb-04 8:55
gkrish525-Feb-04 8:55 
GeneralTroubles with the Parent property (I think) Pin
Andres Coder24-Feb-04 20:26
Andres Coder24-Feb-04 20:26 
GeneralRe: Troubles with the Parent property (I think) Pin
Heath Stewart25-Feb-04 4:46
protectorHeath Stewart25-Feb-04 4:46 
Generalauto checking of NumericUpDown control Pin
azusakt24-Feb-04 17:13
azusakt24-Feb-04 17:13 
GeneralRe: auto checking of NumericUpDown control Pin
Heath Stewart25-Feb-04 4:43
protectorHeath Stewart25-Feb-04 4:43 
GeneralRe: auto checking of NumericUpDown control Pin
azusakt25-Feb-04 15:23
azusakt25-Feb-04 15:23 
GeneralRe: auto checking of NumericUpDown control Pin
Heath Stewart26-Feb-04 2:56
protectorHeath Stewart26-Feb-04 2:56 
GeneralRe: auto checking of NumericUpDown control Pin
Huseyin Altindag25-Feb-04 10:35
Huseyin Altindag25-Feb-04 10:35 
GeneralReports in C# Pin
Anonymous24-Feb-04 16:22
Anonymous24-Feb-04 16:22 
GeneralRe: Reports in C# Pin
Heath Stewart25-Feb-04 4:31
protectorHeath Stewart25-Feb-04 4:31 

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.