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 / October 2006

Tip: Looking for answers? Try searching our database.

Attempted to call a method declared on type 'MyInterface' on an object which exposes 'RemotableTypeObject'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amit - 27 Oct 2006 17:08 GMT
Hello All,

I have been searching for a solution for the last 2 days. As a last
resort, I am turning to this group. Please help.

I have an assembly called "RemoteObjectsInterfaces.dll" that has an
interface called "IHelloWorldInterface". I have another assembly called
"RemoteObjects.dll" that has a class called "HelloWorldRemoteObject"
that inherits from MarshalByRefObject and implements
"IHelloWorldInterface".

I have created a folder on the server in C:\Inetpub\wwwroot called
"RemoteObjects" that has a "bin" folder that holds
"RemoteObjectsInterfaces.dll" and "RemoteObjects.dll". I have created a
virtual directory in IIS6.0 called "RemoteObjectsVirDir" that points to
C:\Inetpub\wwwroot\RemoteObjects.

C:\Inetpub\wwwroot\RemoteObjects\web.config is as follows:

<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="SingleCall"
type="RemoteObjects.HelloWorldRemoteObject, RemoteObjects"
objectUri="MyHelloWorld.rem"/>
</service>
</application>
</system.runtime.remoting>
<system.web>
<customErrors mode="Off" />
<httpRuntime executionTimeout="1800" maxRequestLength="40960" />
</system.web>
</configuration>

My client test app does the following on a button click:

           HttpChannel h = new HttpChannel();
           ChannelServices.RegisterChannel(h,true);

           IHelloWorldInterface o =
(IHelloWorldInterface)Activator.GetObject(
               typeof(RemoteObjectsInterfaces.IHelloWorldInterface),

"http://10.17.173.161/RemoteObjectsVirDir/MyHelloWorld.rem");

           if (o != null)
           {
                label1.Text = o.HelloWorld("ABC");
           }

I get the following error:

Attempted to call a method declared on type
'RemoteObjectsInterfaces.IHelloWorldInterface' on an object which
exposes 'RemoteObjects.HelloWorldRemoteObject'.

I'm pretty sure it's something trivial...

Thanks much in advance!!!
Amit - 27 Oct 2006 19:13 GMT
Duh! All I had to do was specify the namespace in the client side code.

RemoteObjectInterfaces.IHelloWorldInterface o =
(RemoteObjectInterfaces.IHelloWorldInterface)Activator.GetObject(
typeof(RemoteObjectInterfaces.IHelloWorldInterface),
"http://ipaddress/RemotObjectsVirDir/MyHelloWorld.rem");

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.