Bug 45816 - There is no working System.Runtime.Remoting.dll for Xamarin.Mac v4.5 Cocoa apps.
Summary: There is no working System.Runtime.Remoting.dll for Xamarin.Mac v4.5 Cocoa apps.
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Base Class Libraries ()
Version: Master
Hardware: Other Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-23 16:33 UTC by Gergely Bacsó
Modified: 2016-10-26 16:06 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project. (346.76 KB, application/x-zip-compressed)
2016-10-23 16:33 UTC, Gergely Bacsó
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Gergely Bacsó 2016-10-23 16:33:34 UTC
Created attachment 18183 [details]
Sample project.

There is no working System.Runtime.Remoting.dll for Xamarin.Mac v4.5 Cocoa apps.
(Note: the app needs to be v4.5 in order to use P/Invoke.)

Possibilities:
  * v4.5 project:
    - P/Invoke works but System.Runtime.Remoting doesn't (not even by referencing one of the 4.0/2.0 dlls directly).
  * v4.61 project:
    - P/Invoke doesn't work, but System.Runtime.Remoting does.

See sample project / AppDelegate.cs
Comment 1 Chris Hamons 2016-10-25 15:25:25 UTC
System.Runtime.Remoting is not part of the supported API profile in either the Mobile or the XM 4.5 target framework (https://developer.xamarin.com/guides/mac/advanced_topics/target-framework/).

In fact, the new .NET Core APIs from Microsoft do not include it either (https://blogs.msdn.microsoft.com/dotnet/2016/02/10/porting-to-net-core/).

If you wish to include that library, you will need to change your target framework to the unsupported system mono option.

It is very unsafe to reference BCL assemblies from other target frameworks (such as the 4.0/2.0 ones) and is very unlikely to work even if you can make it load.
Comment 2 Gergely Bacsó 2016-10-26 16:06:20 UTC
For those, who still believe in Remoting, and think it's good stuff...

1) Using Xamarin Studio, create a v4.5 library named System.Runtime.Remoting without any additional references.
2) Download the Ipc/Tcp specific files from https://github.com/mono/mono/tree/master/mcs/class/System.Runtime.Remoting and add them to the newly created project.
3) Do some minor corrections (e.g. replacing Consts.AssemblyMono_Posix with "Mono.Posix")
4) Reference your project and have fun with remoting :)

Note: only tested basic functionality with IPC, but it seems to work!