Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6584913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:35:47+00:00 2026-05-25T16:35:47+00:00

Using Remoting in C#, I’m connecting to different servers. As I’m continuously adding features

  • 0

Using Remoting in C#, I’m connecting to different servers. As I’m continuously adding features on the client side, the services on the server side isn’t always up to date.

How can I solve the issue that if I call a method in my interface (which invokes the method remotely on the server) and this method doesn’t exist in the implementation on the server side?

The client naturally crashes because there’s an exception I cannot catch. Yes I could, but as there are many different Methods I call this way, it would be painful to add Exception handling for each of them.

One “solution” I tought about was to put a custom version-attribute to each of the method in my MarshalByRefObject. But I don’t know how to use this afterwards when calling each method. It’s okay for me to add an annotation/attribute to each method, but it again would be a pain to have an if statement asking whether the version is new enough or not.

Another way I thought about was to use inheritance for this.

public abstract class AbstractServer1 : MarshalByRefObject
{
    public abstract void feature1();
}

public abstract class AbstractServer2 : AbstractServer1
{
    public abstract featureInVersion2();
    public abstract string reallyNewFeature();
}

public class ServerClass1 : AbstractServer1
{
    public void feature1();
}

public class ServerClass2 : ServerClass1, AbstractServer2
{
    public void featureInVersion2();
    public string reallyNewFeature();
}

But this would result in something like:

public AbstractServer getRemoteObject(string host, int port)
{
    object obj = Activator.GetObject(typeof(AbstractServer2), "tcp://" + host + ":" + port.ToString() + "/ServiceName");
    if (typeof(obj) == ServerClass1)
    {
        ...
    }
}

And this is neither beautiful nor does it really work.

Is there a good solution to this?

Remark: Using the same assembly file in server and client is unfortunately NOT an option.

Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:35:48+00:00Added an answer on May 25, 2026 at 4:35 pm

    What kind of behavior do you expect when calling a function that do not exists serverside ?

    This code might be usefull to you

    It builds a proxy which catches every exception that occured when calling members of an object implementing a specific interface.
    You could use this on wpf channels or on interface members of your Remoting proxies.

    IMyInterface myService = [...];
    IMyInterface myExceptionLoggedService = ExceptionProxyGenerator.Generate<IMyInterface>(myService);
    (myExceptionLoggedService  as IExceptionProxy).Error+=(sender,method,exception)=>{
       // do what you want on exception
    };
    // Use my service :
    myExceptionLoggedService.MyExistingFunction();// ok
    myExceptionLoggedService.MyNotExistingFunction();// calling the above delegate
    

    You could rewrite a bit this class to have the kind of behavior you want (like not rethrowing the exception on error and returning null -if function is not returning void-)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a client-server application using .Net Remoting. From my server I want
When using .net remoting, does the server limit incoming client remoting calls? I find
We're using .NET Remoting with a Client/Shared/Server architecture where: Shared DLL: common to both
I am using .NET Remoting. My server/hoster is a Windows Service. It will sometimes
I'm using XFire as the Web Services provider for Spring Remoting. I'm using an
I have a complex .NET Remoting server app that provides a couple of services.
When using IPython, osx terminal and remoting into an ubuntu server. I noticed that
We're looking at using Ruby for a client-server (non-web based) project where both the
I am making my first attempts at using PowerShell remoting features. I've set up
I am using WCF service in my client-server application and I am facing following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.