run servers localy
do i need to create 2 different projects , each one for a server?
thanks in advanced
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
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
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
yes, the error go away as soon as i remove the call for the second channel
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
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" ?> Just change the wellknown tag and it should work for your app as well. Regards,
<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>
Vikram
how to put that in the config?
im using an interface so im calling the getType method whice give me the type of the interface thanks for the help