Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / January 2004

Tip: Looking for answers? Try searching our database.

Problem in .NET Remoting with Client Activated Objects(CAO)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Deepal - 29 Jan 2004 12:28 GMT
Hi;
I'm doing an example program from a book regarding .NET Remoting.
Both the Client and Server are C# Console Applications.

Server Code is

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace Wrox.Samples
{
    class SimpleServer
    {
        [STAThread]
        static void Main(string[] args)
        {
            //Create and register the Server Channel
            TcpServerChannel channel=new TcpServerChannel(9000);
            ChannelServices.RegisterChannel(channel);

            RemotingConfiguration.ApplicationName="SimpleServer";
           
            ActivatedServiceTypeEntry remObj=new
ActivatedServiceTypeEntry(typeof(MyRemoteObject));
            RemotingConfiguration.RegisterActivatedServiceType(remObj);

            Console.WriteLine("Press Return To Exit");
            Console.ReadLine();
           
        }
    }
}

And the Remote Object Class in the Wrox.Samples Project is
using System;

namespace Wrox.Samples
{
        public class MyRemoteObject:System.MarshalByRefObject
    {
        public MyRemoteObject()
        {
            Console.WriteLine("Constructor Called");
        }

        public string Hello()
        {
            Console.WriteLine("Hello Called");
            return "Hello, .NET Client!";
        }
    }
}

And my Client Code is

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using Wrox.Samples;
using System.Runtime.Remoting.Activation;

namespace WS
{
    class SimpleClient
    {
        [STAThread]
        static void Main(string[] args)
        {
            //Create and Register the Client Channel
            TcpClientChannel channel=new TcpClientChannel();
            ChannelServices.RegisterChannel(channel);

            ActivatedClientTypeEntry entry=new
ActivatedClientTypeEntry(typeof(MyRemoteObject),"tcp://localhost:9000/");
        RemotingConfiguration.RegisterActivatedClientType(entry);           
                                                         
            MyRemoteObject obj=new MyRemoteObject();//###Exception Occures
here

            for (int i=0; i<5; i++)
            {
                Console.WriteLine(obj.Hello());
            }
            Console.ReadLine();           
        }
    }
}

My Problem is When I Run the Server and the Client in the Client where
I'm Instantiating the New MyRemoteObject the Following Error Comes.

An unhandled exception of type
'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll

Additional information: Permission denied for activating type
Wrox.Samples.MyRemoteObject, MyRemoteObject, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null.

But for WellKnown and Singleton RemoteObjects it Works Fine.
The error Comes only for CAO Scenario.

Help regarding this problem is highly appreciated.

Thanks
Deepal
Liviu Uba - 30 Jan 2004 16:52 GMT
I have the same problem, look at borland.public.attachments where I posted
2 examples one in D8 the same in VSNET. ( remoting client activation with d8
...).
The example in VS NET is working without any problem.
I think it is a security issue with Borland generated assemblies.
I tried to strongly sign them, but that didn't work either
If you did find a solution, please share it ...

Regards
Liviu Uba
luba@totalsoft.ro

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.