Check out .Net Core, AppDomain, WCF, RPC Marshaling TCP / Ip your bike
The solution itself is very close with the COM out process interaction on IDispatch. I remember with pleasure dealt with TSocketConnection internals.
But, unlike Idispatch, overloading of methods and operators is used, calling Generic methods with type inference or specifying Generic arguments. Support for extension methods for classes that are in the same assembly and for Linq methods.
Also support for asynchronous methods and subscription to events, ref and out parameters, access by index [], support for iterators in foreach.
Unlike Web Api, there is no need to specifically write the server code Controller, Hubs. This is close to the AppDomain c Remouting but, unlike Remoting, each class is analogous to MarshalByRefObject. That is, we can create any object on the server side and return a link to it (some languages from numbers only support double). When calling methods, only the following types of parameters are directly serialized: numbers, strings, date, Guid and byte []. For other types, you need to create them on the server side, and references to them are already passed in the method parameters.