run servers localy

how can i run 2 servers localy in .net remoting? i tried register two different ports in the server side but i got an exception.
do i need to create 2 different projects , each one for a server?
thanks in advanced
[222 byte] By [ppl1] at [2008-2-18]
# 1
Hi,

You did not mention the exception which you got but I am guessing that the error you got is the following:

"The channel tcp is already registered."

If that is so, then see the following post for resolving the issue:
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=12844

Regards,
Vikram

Vikram at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
the error message is- "JIT Debugging component reistration is incorrect"

what i did it create a program (the server side) and in main i wrote-
TcpChannel chan=new TcpChannel(8085);
ChannelServices.RegisterChannel(chan);
TcpChannel anotherChan=new TcpChannel(8086);
ChannelServices.RegisterChannel(anotherChan);

is it poosible to register 2 different channels in one program?
do i need to create 2 different programs for each server?
thanks

ppl1 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3
Hi,

This sounds like a different error. Try running the following command as administrator:
"C:\Program Files\Common Files\Microsoft Shared\VS7Debug\vs7jit.exe"
/RegServer
Does the error go away as soon as you remove the call for the second channel?

It is possible to have 2 different channels in one .EXE.

Regards,
Vikram

Vikram at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4
sorry but i didnt understand exactly what to do...after im getting to "C:\Program Files\Common Files\Microsoft Shared\VS7Debug\vs7jit.exe" -->then what?

yes, the error go away as soon as i remove the call for the second channel

ppl1 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 5
Hi,

I find that a bit strange. The exception that you are receiving does not seem to be anything related to .NET Remoting but some kind of corruption in the JIT Debugger.
Somehow that error seems to be supressing the actual exception thats happening.

Do you have access to another machine where you can try the code?

Regards,
Vikram

Vikram at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 6
so what i did supposed to work?
no, i dont have access to another machine
ppl1 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 7
Hi,

Yes what you are trying is supposed to work. Why dont try moving it to a config file and try ? Its easier to troubleshoot than code.

Here is a sample config file for Remoting on the Server which has two channels:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel name="channel1" ref="tcp" port="5001" >
</channel>
<channel name="channel2" ref="tcp" port="5002" >
</channel>
</channels>
<service>
<wellknown
mode="SingleCall"
type="RemotingServer.RemoteObject1, RemotingServer"
objectUri="RemoteObject1.rem"
/>
</service>
</application>
</system.runtime.remoting>
</configuration>

Just change the wellknown tag and it should work for your app as well.

Regards,
Vikram

Vikram at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 8
im finding it a little bit difficult to put it in a config...maybe you can help me?
the problem is that i wrote-
Type theType=new TasksManagement().GetType();

RemotingConfiguration.RegisterWellKnownServiceType(theType,"Server",WellKnownObjectMode.Singleton);

how to put that in the config?
<wellknown mode="Singleton" type="ServerSide.TaskManagement,ServerSide" objectUri="Server.rem"/>

im using an interface so im calling the getType method whice give me the type of the interface

thanks for the help

ppl1 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 9
it's working now !!
thanks for the help :)
ppl1 at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified