Here is my C# code snippet:
if (Environment.IsWindows) { _sessionAddress = GetSessionBusAddressFromSharedMemory(); } ... [System.Runtime.Versioning.Support