Net4x.Runtime.Remoting
2.0.0
dotnet add package Net4x.Runtime.Remoting --version 2.0.0
NuGet\Install-Package Net4x.Runtime.Remoting -Version 2.0.0
<PackageReference Include="Net4x.Runtime.Remoting" Version="2.0.0" />
<PackageVersion Include="Net4x.Runtime.Remoting" Version="2.0.0" />
<PackageReference Include="Net4x.Runtime.Remoting" />
paket add Net4x.Runtime.Remoting --version 2.0.0
#r "nuget: Net4x.Runtime.Remoting, 2.0.0"
#:package Net4x.Runtime.Remoting@2.0.0
#addin nuget:?package=Net4x.Runtime.Remoting&version=2.0.0
#tool nuget:?package=Net4x.Runtime.Remoting&version=2.0.0
Net4x.Runtime.Remoting
A practical System.Runtime.Remoting compatibility layer for .NET Standard 2.0 and .NET 8+.
Keeps the public remoting API, replaces the transport, replaces serialization, and uses generated interface/subclass proxies in place of the CLR's transparent proxies — so an existing .NET Framework remoting application can be recompiled and run on modern .NET.
Quick start
Server
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
ChannelServices.RegisterChannel(new TcpServerChannel("app", 9000), ensureSecurity: false);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(OrderService), "orders.rem", WellKnownObjectMode.Singleton);
Client
ChannelServices.RegisterChannel(new TcpClientChannel(), ensureSecurity: false);
var orders = (IOrderService)RemotingServices.Connect(
typeof(IOrderService), "tcp://server:9000/orders.rem");
var order = orders.Get(42); // a real cross-process call
Configuration files keep working too:
RemotingConfiguration.Configure("app.config"); // reads <system.runtime.remoting>
What works
Server-activated objects (Singleton and SingleCall), client-activated objects, server-to-client
callbacks and events, ref/out parameters, generic methods, overload resolution by full signature,
properties and indexers, exception marshalling with the original type and data, lifetime leases and
sponsors, CallContext flow, one-way calls, and <system.runtime.remoting> config parsing.
Serialization honours [Serializable], [NonSerialized], private fields, ISerializable,
IObjectReference, IDeserializationCallback, the [On*] callbacks, surrogates, object cycles and
shared references — so existing DTOs travel unchanged. BinaryFormatter is not used anywhere; it throws
on .NET 9+ and was never an option here.
Two source changes you will need
1. Members on a class contract must be virtual.
The CLR's transparent proxy intercepted every member. A generated proxy is a subclass, and a subclass can only override virtual members — a non-virtual one would run locally on the client, silently returning wrong results. Rather than let that happen, proxy creation fails and names every offending member.
public class OrderService : MarshalByRefObject
{
public virtual Order Get(int id) { ... } // add 'virtual'
}
Better still, remote an interface: interface slots are always intercepted, even when the implementing class member is not virtual.
2. Client-activated objects need an explicit factory.
new Foo() was routed through activation by the CLR itself; there is no hook for that off .NET
Framework.
var session = RemotingActivator.CreateInstance<Session>(userId); // was: new Session(userId)
Improvement over classic remoting
Connections are symmetric and multiplexed, so a server calling back into a client-supplied
MarshalByRefObject sends the reverse call down the connection the client already opened. The client
needs no listening port, and callbacks work through NAT and firewalls. RegisterChannel(new TcpChannel(0)) on a client still succeeds, so existing code is unaffected.
Security
Deserialization defaults to TypeFilterLevel.Low, as on .NET Framework: only safe-listed types are
reconstructed, plus assemblies you register with RemotingConfiguration.AllowAssembly. A hard deny list
blocks known gadget-chain entry points at every level.
Remoting endpoints are not hardened against hostile callers. Do not expose one to an untrusted network.
Not included
Wire compatibility with unmodified .NET Framework peers (both ends must reference this package), the
HTTP/SOAP channels, ContextBoundObject and context attributes, and cross-AppDomain marshalling — see
the Net4x.AppDomain package for process-backed application domains.
Proxies are generated with Reflection.Emit, so this package is not compatible with AOT compilation or
full trimming.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Buffers (>= 4.0.0)
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.ILGeneration (>= 4.7.0)
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Net4x.Runtime.Remoting:
| Package | Downloads |
|---|---|
|
Net4x.AppDomain
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 42 | 7/30/2026 |