Bug 40758

Summary: [Regression] Remoting instance is not proxied
Product: [Mono] Class Libraries Reporter: Александр <aleks.maer>
Component: mscorlibAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono
Priority: ---    
Version: 4.4.0 (C7)   
Target Milestone: Untriaged   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: source code
source code
screen

Description Александр 2016-04-28 13:01:09 UTC
Created attachment 15866 [details]
source code

Unable to create a remote object class using Remoting technology Mono version 4.x. On Mono version 3.x everything is working properly.
On Mono version 4.x going to create an object on the client side, and should be on the server side.
I attach the source code of the program.
Comment 1 Marek Safar 2016-05-05 14:09:05 UTC
I cannot reproduce the issue. Using your sample code I get following output

Enter Server IP:
[192.168.1.215] 
05 May 2016 16:03:46

What error do you get?
Comment 2 Александр 2016-05-06 07:19:13 UTC
The error does not occur, but there is no reference to TestServer.
TestClient should not be carried out without TestServer.
Message "[192.168.1.215]" should be displayed on TestServer
Replace source code that we could enter IPAdress:
namespace TestClient
{
    using System;
    using System.Runtime.Remoting.Activation;
    using System.Runtime.Remoting.Channels;
    using System.Runtime.Remoting.Channels.Tcp;
    using Logic;

    class Program
    {
        static void Main ()
        {
            const string clientChannelId = "4486C82E-B97D-45d5-AF71-96EA32AF6119";
            IChannel foundChannel = ChannelServices.GetChannel (clientChannelId);
            if (foundChannel == null)
            {
                var channel = new TcpClientChannel (clientChannelId, null);
                ChannelServices.RegisterChannel (channel, false);
            }

            Console.WriteLine ( "Enter Server IP:");
            string ip = Console.ReadLine ();
            string serverLocation = string.Format ( "{0}: 2003", ip);

object [] url = {new UrlAttribute (string.Format ( "tcp: // {0}", serverLocation))};
            object [] args = {StringExtention.GetCurrentIp ()};
            var mediator = (MpSyncMediator) Activator.CreateInstance (typeof (MpSyncMediator), args, url);

Console.WriteLine (mediator.GetServerDateTime () ToString ( "F").);
Console.ReadKey ();
        }
    }
}
Comment 3 Александр 2016-05-11 06:03:10 UTC
Invalid work Remoting technology Mono version 4.x.
Comment 4 Marek Safar 2016-05-11 09:14:33 UTC
I am not sure I follow. I ran the test with test server running.

The output is from your test-client which does `Console.WriteLine (mediator.GetServerDateTime () ToString ( "F").)`

I am not sure what else to try to reproduce your behaviour which you didn't describe yet.
Comment 5 Александр 2016-05-11 10:24:24 UTC
Created attachment 15966 [details]
source code

Constructor must be executed on the side of TestServer. 

public MpSyncMediator(string str)
{
     Console.WriteLine(str);
}

I have it performed on TestClient.
Comment 6 Александр 2016-05-11 10:31:50 UTC
Created attachment 15967 [details]
screen
Comment 7 Александр 2016-05-11 10:32:34 UTC
Invalid work Remoting technology Mono version 4.x.
Comment 8 Marek Safar 2016-05-11 18:01:36 UTC
Fixed in master