473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Remoting problems

Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />
</service>
<channels>
<channel ref="tcp" port="8086" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

the server looks like this:
-----------------------------------------------
using Interfaces; //added in the referenses
using ClassLib.System; //added in the referenses
RemotingConfiguration.Configure(Environment.Curren tDirectory+"\\server.config");
lblServiceStatus.Text = "Service started";

the client:
-----------------------------------------------
using Interfaces; //added in the referenses
IMyFirstRemotableObj bol;
bol=(IMyFirstRemotableObj)Activator.GetObject(type of(IMyFirstRemotableObj),@"tcp://192.168.2.24:8086/ControlCenter");
MessageBox.Show(bol.GetOSPlatform());

Interfaces:
-----------------------------------------------
using System;
namespace Interfaces
{
public interface IMyFirstRemotableObj
{
string GetOSPlatform();
}
}

ClassLib.System :
-----------------------------------------------
using System;
using Interfaces;
namespace ClassLib.System
{
[Serializable]
public class MyFirstRemotableObj : MarshalByRefObject, IMyFirstRemotableObj
{
public string GetOSPlatform()
{
return Environment.OSVersion.Version.ToString();
}
}
}
And the error:
-----------------------------------------------
System.IO.FileNotFoundException: File or assembly name IMyFirstRemotableObj, or one of its dependencies, was not found.
File name: "IMyFirstRemotableObj"

Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Runtime.Remoting.RemotingConfigInfo.LoadTyp e(String typeName, String assemblyName)
at System.Runtime.Remoting.RemotingConfigInfo.GetServ erTypeForUri(String URI)
at System.Runtime.Remoting.RemotingConfigHandler.GetS erverTypeForUri(String URI)
at System.Runtime.Remoting.RemotingServices.GetServer TypeForUri(String URI)
at System.Runtime.Remoting.Channels.BinaryServerForma tterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at Interfaces.IMyFirstRemotableObj.GetOSPlatform()
at ControlCenter.ControlCenter.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I use this code in the server:
TcpChannel chan = new TcpChannel(8086);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType (typeof(MyFirstRemotableObj),"ControlCenter",WellK nownObjectMode.SingleCall);

Instead of
RemotingConfiguration.Configure(Environment.Curren tDirectory+"\\server.config");

then it will work fine, what's wrong?
Jul 21 '05 #1
15 3938
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />


<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny
Jul 21 '05 #2
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />


<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny
Jul 21 '05 #3
Sorry,
a little mistake, the type exposed to remoting in <wellknown> should be
the type of your object, not the interface. The server needs to know
what kind of object instaniates. It can not instaniate an interface. So
your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...

Sunny
In article <Op*************@tk2msftngp13.phx.gbl>,
su***@newsgroups.nospam says...
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />


<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny

Jul 21 '05 #4
Sorry,
a little mistake, the type exposed to remoting in <wellknown> should be
the type of your object, not the interface. The server needs to know
what kind of object instaniates. It can not instaniate an interface. So
your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...

Sunny
In article <Op*************@tk2msftngp13.phx.gbl>,
su***@newsgroups.nospam says...
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />


<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny

Jul 21 '05 #5
Yes I do!

In the applications directory I have these files:
server.config
Interfaces.dll
ClassLib.dll
ControlCenter.exe - the server/client
and 2 more DLL:s, not relevant to this problem.

The client and server is currently in the same exe-file but I'm running it on 2 different computers

I've also tried this:
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="ClassLib.System, MyFirstRemotableObj" objectUri="ControlCenter" />
</service>
<channels>
<channel ref="tcp" port="8086" />
<serverProviders>
<provider ref="wsdl" />
<formatter ref="soap" typeFilterLevel="Full" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channels>
</application>
</system.runtime.remoting>
</configuration>

This gives me the error:
System.IO.FileNotFoundException: File or assembly name MyFirstRemotableObj, or one of its dependencies, was not found.
File name: "MyFirstRemotableObj"

Regards
Anders Aleborg

"Glyn" wrote:
Have you got a copy of the interface assembly in the same directory as the client?

I must admit though, that if this is the problem it shouldn't work by NOT using a configuration file.

If I have time tonight I'll try it out and see what happens

Glyn Richards
MCSD .NET
"an****@aleborg.se" wrote:
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />
</service>
<channels>
<channel ref="tcp" port="8086" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

the server looks like this:
-----------------------------------------------
using Interfaces; //added in the referenses
using ClassLib.System; //added in the referenses
RemotingConfiguration.Configure(Environment.Curren tDirectory+"\\server.config");
lblServiceStatus.Text = "Service started";

the client:
-----------------------------------------------
using Interfaces; //added in the referenses
IMyFirstRemotableObj bol;
bol=(IMyFirstRemotableObj)Activator.GetObject(type of(IMyFirstRemotableObj),@"tcp://192.168.2.24:8086/ControlCenter");
MessageBox.Show(bol.GetOSPlatform());

Interfaces:
-----------------------------------------------
using System;
namespace Interfaces
{
public interface IMyFirstRemotableObj
{
string GetOSPlatform();
}
}

ClassLib.System :
-----------------------------------------------
using System;
using Interfaces;
namespace ClassLib.System
{
[Serializable]
public class MyFirstRemotableObj : MarshalByRefObject, IMyFirstRemotableObj
{
public string GetOSPlatform()
{
return Environment.OSVersion.Version.ToString();
}
}
}
And the error:
-----------------------------------------------
System.IO.FileNotFoundException: File or assembly name IMyFirstRemotableObj, or one of its dependencies, was not found.
File name: "IMyFirstRemotableObj"

Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Runtime.Remoting.RemotingConfigInfo.LoadTyp e(String typeName, String assemblyName)
at System.Runtime.Remoting.RemotingConfigInfo.GetServ erTypeForUri(String URI)
at System.Runtime.Remoting.RemotingConfigHandler.GetS erverTypeForUri(String URI)
at System.Runtime.Remoting.RemotingServices.GetServer TypeForUri(String URI)
at System.Runtime.Remoting.Channels.BinaryServerForma tterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at Interfaces.IMyFirstRemotableObj.GetOSPlatform()
at ControlCenter.ControlCenter.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I use this code in the server:
TcpChannel chan = new TcpChannel(8086);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType (typeof(MyFirstRemotableObj),"ControlCenter",WellK nownObjectMode.SingleCall);

Instead of
RemotingConfiguration.Configure(Environment.Curren tDirectory+"\\server.config");

then it will work fine, what's wrong?

Jul 21 '05 #6
Yes I do!

In the applications directory I have these files:
server.config
Interfaces.dll
ClassLib.dll
ControlCenter.exe - the server/client
and 2 more DLL:s, not relevant to this problem.

The client and server is currently in the same exe-file but I'm running it on 2 different computers

I've also tried this:
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="ClassLib.System, MyFirstRemotableObj" objectUri="ControlCenter" />
</service>
<channels>
<channel ref="tcp" port="8086" />
<serverProviders>
<provider ref="wsdl" />
<formatter ref="soap" typeFilterLevel="Full" />
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channels>
</application>
</system.runtime.remoting>
</configuration>

This gives me the error:
System.IO.FileNotFoundException: File or assembly name MyFirstRemotableObj, or one of its dependencies, was not found.
File name: "MyFirstRemotableObj"

Regards
Anders Aleborg

"Glyn" wrote:
Have you got a copy of the interface assembly in the same directory as the client?

I must admit though, that if this is the problem it shouldn't work by NOT using a configuration file.

If I have time tonight I'll try it out and see what happens

Glyn Richards
MCSD .NET
"an****@aleborg.se" wrote:
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />
</service>
<channels>
<channel ref="tcp" port="8086" />
</channels>
</application>
</system.runtime.remoting>
</configuration>

the server looks like this:
-----------------------------------------------
using Interfaces; //added in the referenses
using ClassLib.System; //added in the referenses
RemotingConfiguration.Configure(Environment.Curren tDirectory+"\\server.config");
lblServiceStatus.Text = "Service started";

the client:
-----------------------------------------------
using Interfaces; //added in the referenses
IMyFirstRemotableObj bol;
bol=(IMyFirstRemotableObj)Activator.GetObject(type of(IMyFirstRemotableObj),@"tcp://192.168.2.24:8086/ControlCenter");
MessageBox.Show(bol.GetOSPlatform());

Interfaces:
-----------------------------------------------
using System;
namespace Interfaces
{
public interface IMyFirstRemotableObj
{
string GetOSPlatform();
}
}

ClassLib.System :
-----------------------------------------------
using System;
using Interfaces;
namespace ClassLib.System
{
[Serializable]
public class MyFirstRemotableObj : MarshalByRefObject, IMyFirstRemotableObj
{
public string GetOSPlatform()
{
return Environment.OSVersion.Version.ToString();
}
}
}
And the error:
-----------------------------------------------
System.IO.FileNotFoundException: File or assembly name IMyFirstRemotableObj, or one of its dependencies, was not found.
File name: "IMyFirstRemotableObj"

Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Runtime.Remoting.RemotingConfigInfo.LoadTyp e(String typeName, String assemblyName)
at System.Runtime.Remoting.RemotingConfigInfo.GetServ erTypeForUri(String URI)
at System.Runtime.Remoting.RemotingConfigHandler.GetS erverTypeForUri(String URI)
at System.Runtime.Remoting.RemotingServices.GetServer TypeForUri(String URI)
at System.Runtime.Remoting.Channels.BinaryServerForma tterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at Interfaces.IMyFirstRemotableObj.GetOSPlatform()
at ControlCenter.ControlCenter.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I use this code in the server:
TcpChannel chan = new TcpChannel(8086);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType (typeof(MyFirstRemotableObj),"ControlCenter",WellK nownObjectMode.SingleCall);

Instead of
RemotingConfiguration.Configure(Environment.Curren tDirectory+"\\server.config");

then it will work fine, what's wrong?

Jul 21 '05 #7
please se my reply to Glyn

"Sunny" wrote:
Sorry,
a little mistake, the type exposed to remoting in <wellknown> should be
the type of your object, not the interface. The server needs to know
what kind of object instaniates. It can not instaniate an interface. So
your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...

Sunny
In article <Op*************@tk2msftngp13.phx.gbl>,
su***@newsgroups.nospam says...
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />


<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny

Jul 21 '05 #8
please se my reply to Glyn

"Sunny" wrote:
Sorry,
a little mistake, the type exposed to remoting in <wellknown> should be
the type of your object, not the interface. The server needs to know
what kind of object instaniates. It can not instaniate an interface. So
your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...

Sunny
In article <Op*************@tk2msftngp13.phx.gbl>,
su***@newsgroups.nospam says...
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
Hi!

I have a config file that looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />


<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny

Jul 21 '05 #9
Hi,
in my first post I have wrote that yout "type" element of the
<wellknown> tag is wrong. The class name should be placed before the
assembly name, not the way you use it.

Sunny
In article <4E**********************************@microsoft.co m>,
an****@aleborg.se says...
please se my reply to Glyn

"Sunny" wrote:
Sorry,
a little mistake, the type exposed to remoting in <wellknown> should be
the type of your object, not the interface. The server needs to know
what kind of object instaniates. It can not instaniate an interface. So
your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...

Sunny
In article <Op*************@tk2msftngp13.phx.gbl>,
su***@newsgroups.nospam says...
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
> Hi!
>
> I have a config file that looks like this:
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <system.runtime.remoting>
> <application>
> <service>
> <wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />

<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny

Jul 21 '05 #10
Hi,
in my first post I have wrote that yout "type" element of the
<wellknown> tag is wrong. The class name should be placed before the
assembly name, not the way you use it.

Sunny
In article <4E**********************************@microsoft.co m>,
an****@aleborg.se says...
please se my reply to Glyn

"Sunny" wrote:
Sorry,
a little mistake, the type exposed to remoting in <wellknown> should be
the type of your object, not the interface. The server needs to know
what kind of object instaniates. It can not instaniate an interface. So
your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...

Sunny
In article <Op*************@tk2msftngp13.phx.gbl>,
su***@newsgroups.nospam says...
Hi,

In article <6F**********************************@microsoft.co m>,
an****@aleborg.se says...
> Hi!
>
> I have a config file that looks like this:
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <system.runtime.remoting>
> <application>
> <service>
> <wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />

<wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....

from <wellknown> element docs:

<wellknown
type="ServerActivatedType, RemoteAssembly"
objectUri="ServerType.rem"
mode="Singleton"
/>

I.e. first goes the type, next the assembly.

Hope that helps
Cheers
Sunny

Jul 21 '05 #11
Hi,
try:

type="ClassLib.System.MyFirstRemotableObj, ClassLib"
if it fails, please post a copy of the exception.

Also, there is no way using all these lines to produce exactly the same
error. In the error message it says which class/file it can not find. As
the combinations are different, there should be different errors.

Sunny
In article <E3**********************************@microsoft.co m>,
an****@aleborg.se says...
I've tried:
type="IMyFirstRemotableObj,Interfaces"
type="MyFirstRemotableObj,Interfaces"
type="MyFirstRemotableObj,ClassLib"
type="MyFirstRemotableObj,ClassLib.dll"
type="MyFirstRemotableObj,ClassLib.System"
type="IMyFirstRemotableObj,ClassLib"
type="ClassLib.System,MyFirstRemotableObj"
type="Interfaces,IMyFirstRemotableObj"
type="Interfaces,MyFirstRemotableObj"

Same error on all!

"Sunny" wrote:
Hi,
in my first post I have wrote that yout "type" element of the
<wellknown> tag is wrong. The class name should be placed before the
assembly name, not the way you use it.

Sunny
In article <4E**********************************@microsoft.co m>,
an****@aleborg.se says...
please se my reply to Glyn

"Sunny" wrote:

> Sorry,
> a little mistake, the type exposed to remoting in <wellknown> should be
> the type of your object, not the interface. The server needs to know
> what kind of object instaniates. It can not instaniate an interface. So
> your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...
>
> Sunny
>
>
> In article <Op*************@tk2msftngp13.phx.gbl>,
> su***@newsgroups.nospam says...
> > Hi,
> >
> > In article <6F**********************************@microsoft.co m>,
> > an****@aleborg.se says...
> > > Hi!
> > >
> > > I have a config file that looks like this:
> > > <?xml version="1.0" encoding="utf-8" ?>
> > > <configuration>
> > > <system.runtime.remoting>
> > > <application>
> > > <service>
> > > <wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />
> >
> > <wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....
> >
> > from <wellknown> element docs:
> >
> > <wellknown
> > type="ServerActivatedType, RemoteAssembly"
> > objectUri="ServerType.rem"
> > mode="Singleton"
> > />
> >
> > I.e. first goes the type, next the assembly.
> >
> > Hope that helps
> > Cheers
> > Sunny
> >
>

Jul 21 '05 #12
Hi,
try:

type="ClassLib.System.MyFirstRemotableObj, ClassLib"
if it fails, please post a copy of the exception.

Also, there is no way using all these lines to produce exactly the same
error. In the error message it says which class/file it can not find. As
the combinations are different, there should be different errors.

Sunny
In article <E3**********************************@microsoft.co m>,
an****@aleborg.se says...
I've tried:
type="IMyFirstRemotableObj,Interfaces"
type="MyFirstRemotableObj,Interfaces"
type="MyFirstRemotableObj,ClassLib"
type="MyFirstRemotableObj,ClassLib.dll"
type="MyFirstRemotableObj,ClassLib.System"
type="IMyFirstRemotableObj,ClassLib"
type="ClassLib.System,MyFirstRemotableObj"
type="Interfaces,IMyFirstRemotableObj"
type="Interfaces,MyFirstRemotableObj"

Same error on all!

"Sunny" wrote:
Hi,
in my first post I have wrote that yout "type" element of the
<wellknown> tag is wrong. The class name should be placed before the
assembly name, not the way you use it.

Sunny
In article <4E**********************************@microsoft.co m>,
an****@aleborg.se says...
please se my reply to Glyn

"Sunny" wrote:

> Sorry,
> a little mistake, the type exposed to remoting in <wellknown> should be
> the type of your object, not the interface. The server needs to know
> what kind of object instaniates. It can not instaniate an interface. So
> your wellknow part shoud contain MyFirstRemotableObj, not IMyFirst...
>
> Sunny
>
>
> In article <Op*************@tk2msftngp13.phx.gbl>,
> su***@newsgroups.nospam says...
> > Hi,
> >
> > In article <6F**********************************@microsoft.co m>,
> > an****@aleborg.se says...
> > > Hi!
> > >
> > > I have a config file that looks like this:
> > > <?xml version="1.0" encoding="utf-8" ?>
> > > <configuration>
> > > <system.runtime.remoting>
> > > <application>
> > > <service>
> > > <wellknown mode="SingleCall" type="Interfaces, IMyFirstRemotableObj" objectUri="ControlCenter" />
> >
> > <wellknown mode=... type="IMyFirstRemotableObj, Interfaces"....
> >
> > from <wellknown> element docs:
> >
> > <wellknown
> > type="ServerActivatedType, RemoteAssembly"
> > objectUri="ServerType.rem"
> > mode="Singleton"
> > />
> >
> > I.e. first goes the type, next the assembly.
> >
> > Hope that helps
> > Cheers
> > Sunny
> >
>

Jul 21 '05 #13
Hi,

In article <08**********************************@microsoft.co m>,
an****@aleborg.se says...
Great, that did the trick :D Thanks!!!
Next question, I tried this:
<service>
<wellknown mode="SingleCall" type="ClassLib.System.MyFirstRemotableObj, ClassLib" objectUri="ControlCenter" />
<wellknown mode="SingleCall" type="ClassLib.System.MySecondRemotableObj, ClassLib" objectUri="ControlCenter" />
</service>
You are trying to expose 2 different objects on the same uri. This is
not possible. You should select different uris.

The project I'm working with contains a great number of classes in different folders,
ClassLib.System
ClassLib.IIS
ClassLib.Common
etc...
And we need to be able to talk to all classes through remoting, how can that be done?
As I said, expose them with different uris.

And the last question, security, how can we make the remoting secure?
Only our developed applications should be able to talk with the remoting server and the traffic should be encrypted. Everything will be behind firewalls but we wan't to be shure... How can we solve it? From what I've heard TCP and binary is the best format to use, correct?


There were some discussions in the newsgroups, that it is nearly
impossible to implement application signature type of security. As far
as your application can be disassembled not with big efforts, any
implementation you put in there to identify the application, can easily
be duplicated. There is no build-in mechanism, so you have to implement
something by yourself. But I can not get the point, if you are behind
firewalls, and the use will be only internal, how can any external
application try to connect to your server classes?
One way or another, such an application identification should be
implemented. You can use custom channel syncs to to add some
identification to every remoting call.

If you need user authentication, you can go with IIS hosted remoting
objects, and use IIS's security.

The same applies to the encryption as well - you may use IIS as host and
use it's SSL capabilities.

The problem is that with IIS hosted objects you have to use HTTP
channel. But still you can use binary formatter. HTTP is a little bit
slower than TCP, and adding encryption will slow down the thinks more.

Most probably you should rethink your architecture, etc.

You may take a look at third party solutions like genuine channels. They
have encrypted TCP channels, and are not expensive.

Cheers
Sunny
Jul 21 '05 #14
Thanks :)

"Sunny" wrote:
Hi,

In article <08**********************************@microsoft.co m>,
an****@aleborg.se says...
Great, that did the trick :D Thanks!!!
Next question, I tried this:
<service>
<wellknown mode="SingleCall" type="ClassLib.System.MyFirstRemotableObj, ClassLib" objectUri="ControlCenter" />
<wellknown mode="SingleCall" type="ClassLib.System.MySecondRemotableObj, ClassLib" objectUri="ControlCenter" />
</service>


You are trying to expose 2 different objects on the same uri. This is
not possible. You should select different uris.

The project I'm working with contains a great number of classes in different folders,
ClassLib.System
ClassLib.IIS
ClassLib.Common
etc...
And we need to be able to talk to all classes through remoting, how can that be done?


As I said, expose them with different uris.

And the last question, security, how can we make the remoting secure?
Only our developed applications should be able to talk with the remoting server and the traffic should be encrypted. Everything will be behind firewalls but we wan't to be shure... How can we solve it? From what I've heard TCP and binary is the best format to use, correct?


There were some discussions in the newsgroups, that it is nearly
impossible to implement application signature type of security. As far
as your application can be disassembled not with big efforts, any
implementation you put in there to identify the application, can easily
be duplicated. There is no build-in mechanism, so you have to implement
something by yourself. But I can not get the point, if you are behind
firewalls, and the use will be only internal, how can any external
application try to connect to your server classes?
One way or another, such an application identification should be
implemented. You can use custom channel syncs to to add some
identification to every remoting call.

If you need user authentication, you can go with IIS hosted remoting
objects, and use IIS's security.

The same applies to the encryption as well - you may use IIS as host and
use it's SSL capabilities.

The problem is that with IIS hosted objects you have to use HTTP
channel. But still you can use binary formatter. HTTP is a little bit
slower than TCP, and adding encryption will slow down the thinks more.

Most probably you should rethink your architecture, etc.

You may take a look at third party solutions like genuine channels. They
have encrypted TCP channels, and are not expensive.

Cheers
Sunny

Jul 21 '05 #15
Got a new problem, I get this error:
System.Runtime.Remoting.RemotingException: Det gick inte att hitta begärd tjänst

Server stack trace:
at System.Runtime.Remoting.Channels.BinaryServerForma tterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at Interfaces.IMerak.set_DomainName(String value)
at ControlCenter.ControlCenter.button2_Click(Object sender, EventArgs e) in d:\c#\webcresiterweb\controlcenter\controlcenter.c s:line 248

The code I'm using works fine If I run it without remoting:
IMerak mail;
mail=(IMerak)Activator.GetObject(typeof(IMerak),@" tcp://localhost:8086/Merak");
mail.DomainName = "test.se"; //complains on this line...
mail.Domain_Accounts = 25;
mail.Domain_Description = "test";
mail.Domain_DiskQuota = 1024;
MessageBox.Show(mail.CreateDomain().ToString());

the interface looks like this:
public interface IMerak
{
string DomainName
{
set;
}
bool GetUser();
DataSet GetAllUsers();
bool GetUnknownUsers();
bool GetDomain();
int Domain_Accounts
{
get;
set;
}
int Domain_DiskQuota
{
get;
set;
}
string Domain_Description
{
get;
set;
}
string Domain_Type
{
get;
set;
}
string Domain_Value
{
get;
set;
}
string Domain_UnknownUsers
{
get;
set;
}
string Domain_UnknownUsersForward
{
get;
set;
}
bool CreateDomain();
bool CreateUser();
bool DeleteDomain();
bool DeleteUser();
bool UpdateUnknownUsers();
bool UpdateUser();
}

"Sunny" wrote:
Hi,

In article <08**********************************@microsoft.co m>,
an****@aleborg.se says...
Great, that did the trick :D Thanks!!!
Next question, I tried this:
<service>
<wellknown mode="SingleCall" type="ClassLib.System.MyFirstRemotableObj, ClassLib" objectUri="ControlCenter" />
<wellknown mode="SingleCall" type="ClassLib.System.MySecondRemotableObj, ClassLib" objectUri="ControlCenter" />
</service>


You are trying to expose 2 different objects on the same uri. This is
not possible. You should select different uris.

The project I'm working with contains a great number of classes in different folders,
ClassLib.System
ClassLib.IIS
ClassLib.Common
etc...
And we need to be able to talk to all classes through remoting, how can that be done?


As I said, expose them with different uris.

And the last question, security, how can we make the remoting secure?
Only our developed applications should be able to talk with the remoting server and the traffic should be encrypted. Everything will be behind firewalls but we wan't to be shure... How can we solve it? From what I've heard TCP and binary is the best format to use, correct?


There were some discussions in the newsgroups, that it is nearly
impossible to implement application signature type of security. As far
as your application can be disassembled not with big efforts, any
implementation you put in there to identify the application, can easily
be duplicated. There is no build-in mechanism, so you have to implement
something by yourself. But I can not get the point, if you are behind
firewalls, and the use will be only internal, how can any external
application try to connect to your server classes?
One way or another, such an application identification should be
implemented. You can use custom channel syncs to to add some
identification to every remoting call.

If you need user authentication, you can go with IIS hosted remoting
objects, and use IIS's security.

The same applies to the encryption as well - you may use IIS as host and
use it's SSL capabilities.

The problem is that with IIS hosted objects you have to use HTTP
channel. But still you can use binary formatter. HTTP is a little bit
slower than TCP, and adding encryption will slow down the thinks more.

Most probably you should rethink your architecture, etc.

You may take a look at third party solutions like genuine channels. They
have encrypted TCP channels, and are not expensive.

Cheers
Sunny

Jul 21 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dennis Owens | last post by:
Read below for previous conversation. We are developing an application that will some day run on anything from a computer down to a PDA (this is were the Lightweight comes in). The messaging...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
5
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
4
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS...
0
by: Martijn Damen | last post by:
Hi, At the moment I am trying to develop an application that uses another app over .net remoting and having some problems with it (ok, that is ofcourse why I am here), hope somebody can shine a...
9
by: anders | last post by:
Hi! I have a config file that looks like this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.runtime.remoting> <application> <service> <wellknown mode="SingleCall"...
2
by: =?Utf-8?B?Q2hyaXN0aWFuIEhhdmVs?= | last post by:
Hi, in a existing application (DCOM server and client, both in VC++) we have very often problems with the DCOM-configuration. Is the requiered configuration (open ports) in applications using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.