# In IL2CPP Debug builds, starting a Replication Server through Launcher.Create kills the player with a Visual C++ assertion dialog

**URL:** <https://community.coherence.io/t/in-il2cpp-debug-builds-starting-a-replication-server-through-launcher-create-kills-the-player-with-a-visual-c-assertion-dialog/814>\
**Category:** Bug reports\
**Created:** [September 4, 2026, 7:55pm UTC](https://community.coherence.io/t/in-il2cpp-debug-builds-starting-a-replication-server-through-launcher-create-kills-the-player-with-a-visual-c-assertion-dialog/814 "2026-09-04T19:55:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scornillon](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@scornillon](https://community.coherence.io/u/scornillon)\
**Post date:** [September 4, 2026, 7:55pm UTC](https://community.coherence.io/t/in-il2cpp-debug-builds-starting-a-replication-server-through-launcher-create-kills-the-player-with-a-visual-c-assertion-dialog/814/1 "2026-09-04T19:55:24Z")

</div>

(Please make the title of your topic brief but informative, and post error messages under the next heading _Details and error message(s)_)

## Description, details and error message(s)

A Windows IL2CPP player aborts the moment it starts a self-hosted Replication Server through  
`Launcher.Create`. The process dies with a C runtime dialog. There is no managed exception, no Unity crash dump, and no Windows Error Reporting record — the Player.log simply stops mid-line.

```auto
Microsoft Visual C++ Runtime Library
Debug Assertion Failed!
Program: ...\GameAssembly.dll
File: <UnityEditor>\Data\il2cpp\libil2cpp\icalls\System\System.Diagnostics\Process.cpp
Line: 40
Expression: 0 && "Process::GetProcesses_internal"

```

The cause is in `Launcher.Create` (Coherence.Toolkit/ReplicationServer/Launcher.cs):

```csharp
var process = new NlProcess(startupInfo);
if (process.IsProcessAlreadyRunning())
{
    throw new System.Exception("RS is already running.");
}

```

`NlProcess.IsProcessAlreadyRunning()` (Coherence.Plugins/NativeLauncher/NlProcess.cs) calls `System.Diagnostics.Process.GetProcessesByName(...)`, which reaches the`Process::GetProcesses_internal`icall. IL2CPP does not implement it:

```cpp
Il2CppArray* Process::GetProcesses_internal()
{
    IL2CPP_NOT_IMPLEMENTED_ICALL(Process::GetProcesses_internal);
    return 0;
}

```

`IL2CPP_NOT_IMPLEMENTED_ICALL` expands to `IL2CPP_ASSERT(0 && ...)`, which is a native abort whenever`IL2CPP_DEBUG` is defined. `IL2CPP_DEBUG` is defined when the player is built with  
`Il2CppCompilerConfiguration.Debug`, a normal choice for development builds because it cuts C++ compile time substantially. The `try/catch` inside `IsProcessAlreadyRunning` cannot catch a native abort.

There is a second-order problem. With `Il2CppCompilerConfiguration.Release` the assert compiles to`void(0)` and the icall returns null. The BCL then dereferences a null array and the outer`catch (Exception)` in `IsProcessAlreadyRunning` returns `false`. So the duplicate-server guard never  
functions in any IL2CPP player: it either aborts the process or silently answers “not running”,  
whatever is actually running.

Worth noting that the native launcher (`native_utils.dll`) was added in 1.4.0 specifically so IL2CPP players could launch a Replication Server, because `Process.Start` is equally unimplemented under IL2CPP (`Process::CreateProcess_internal`, same source file). `IsProcessAlreadyRunning` reintroduces a `System.Diagnostics.Process` dependency on that same path.

## Expected behaviour

`Launcher.Create` should return a usable `IReplicationServer` in an IL2CPP player, as it does under Mono and in the Editor. The duplicate-server check should either work under IL2CPP or be skipped there, rather than aborting the process.

## Screenshots

## How to reproduce

**Rate:**  
_Every time_

**Steps:**

1. Build a Windows Standalone player with Scripting Backend = IL2CPP and  
`Il2CppCompilerConfiguration.Debug` (Player Settings \> C++ Compiler Configuration = Debug).

2. In that player, call:

3. 

```csharp
var config = new ReplicationServerConfig
{
    Mode = Mode.World,
    APIPort = (ushort)RuntimeSettings.Instance.WorldsAPIPort,
    UDPPort = (ushort)RuntimeSettings.Instance.LocalWorldUDPPort,
    SignallingPort = (ushort)(RuntimeSettings.Instance.LocalWorldUDPPort + 1),
    SendFrequency = 20,
    ReceiveFrequency = 60,
    AutoShutdownTimeout = 60000,
};

var server = Launcher.Create(config); // aborts here
server.Start();

```

4. The player aborts inside `Launcher.Create`, before `Start` is reached. Setting C++ Compiler Configuration to Release removes the abort, but then the check silently always  
returns false, as described above.

## Environment

- coherence SDK: 2.2.0
- Unity: 6000.5.7f1
- OS / Platform: Windows 11, Standalone Windows x64, IL2CPP, Development Build
- Replication Server: v8.1.3

## Suggested fix

Answer the “already running” question through the native launcher rather than  
`System.Diagnostics.Process`, or skip the check under `ENABLE_IL2CPP` so `Create` cannot abort.

---

<div class="post-metadata">

**Author:** ![Filip](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/filip/32/142_2.png) [@Filip](https://community.coherence.io/u/Filip)\
**Post date:** [September 16, 2026, 9:38am UTC](https://community.coherence.io/t/in-il2cpp-debug-builds-starting-a-replication-server-through-launcher-create-kills-the-player-with-a-visual-c-assertion-dialog/814/2 "2026-09-16T09:38:18Z")

</div>

Hey,

Thanks a bunch for the thorough report. The bug has been fixed and will ship in the next release.
