Checklist
What happened?
On macOS, LuaCs selects C# assembly resources declared with Platform="Linux" instead of the corresponding Platform="OSX" resources.
For a mod that ships normal per-platform assemblies:
<Assembly File="%ModDir%/bin/Client/Linux/TestMod.dll"
Target="Client"
Platform="Linux" />
<Assembly File="%ModDir%/bin/Client/OSX/TestMod.dll"
Target="Client"
Platform="OSX" />
<Assembly File="%ModDir%/bin/Client/Windows/TestMod.dll"
Target="Client"
Platform="Windows" />
the macOS client attempts to load the Linux assembly. If that assembly exposes MonoGame types, package type discovery fails because MonoGame.Framework.Linux.NetStandard is unavailable on macOS.
Expected behavior: the macOS client should select only the Platform="OSX" resource.
Reproduction steps
- Run the macOS LuaCs client.
- Enable a C# mod containing both Linux and OSX assembly entries as shown above.
- Make the Linux assembly reference
MonoGame.Framework.Linux.NetStandard and the OSX assembly reference MonoGame.Framework.MacOS.NetStandard.
- Start the game and let LuaCs load the package.
- Observe that LuaCs attempts to load the Linux assembly.
Removing/commenting the Linux entry prevents the Linux assembly from being selected, but this is only a package-level workaround and breaks proper Linux distribution.
Runtime verification
Reading the fields from the installed macOS Barotrauma.dll produces:
Barotrauma.ModUtils+Environment.CurrentPlatform = Linux
AssemblyInfo.CurrentPlatform = MacOS
This confirms that the base game identifies the platform correctly, while LuaCs reports Linux.
Possible cause
The macOS projects define the OSX compilation symbol:
However, ModUtils.Environment.CurrentPlatform checks MACOS, then falls back to Linux:
#elif MACOS
Platform.MacOS;
...
#else
Platform.Linux;
#endif
There are two mismatched names:
- The compilation symbol is
OSX, not MACOS.
- The LuaCs platform enum contains
OSX, not MacOS.
PackageManagementService.SelectCompatible then filters resources using this incorrect value:
Relevant error
[CL] FluentResults: Error: Failed to get types from Package 'Vanilla_Components_Expanded'
System.Reflection.ReflectionTypeLoadException:
Unable to load one or more of the requested types.
Could not load file or assembly
'MonoGame.Framework.Linux.NetStandard, Version=3.7.0.0,
Culture=neutral, PublicKeyToken=null'.
The system cannot find the file specified.
Environment
- OS: macOS 15.7
- Barotrauma: 1.12.7.0
- LuaCsForBarotrauma:
latest, commit 0d380afcd1feeb842c0c86290d46bcaf198cd5e4

Checklist
What happened?
On macOS, LuaCs selects C# assembly resources declared with
Platform="Linux"instead of the correspondingPlatform="OSX"resources.For a mod that ships normal per-platform assemblies:
the macOS client attempts to load the Linux assembly. If that assembly exposes MonoGame types, package type discovery fails because
MonoGame.Framework.Linux.NetStandardis unavailable on macOS.Expected behavior: the macOS client should select only the
Platform="OSX"resource.Reproduction steps
MonoGame.Framework.Linux.NetStandardand the OSX assembly referenceMonoGame.Framework.MacOS.NetStandard.Removing/commenting the Linux entry prevents the Linux assembly from being selected, but this is only a package-level workaround and breaks proper Linux distribution.
Runtime verification
Reading the fields from the installed macOS
Barotrauma.dllproduces:This confirms that the base game identifies the platform correctly, while LuaCs reports Linux.
Possible cause
The macOS projects define the
OSXcompilation symbol:MacClient.csprojHowever,
ModUtils.Environment.CurrentPlatformchecksMACOS, then falls back to Linux:ModUtils.csThere are two mismatched names:
OSX, notMACOS.OSX, notMacOS.PackageManagementService.SelectCompatiblethen filters resources using this incorrect value:PackageManagementService.csRelevant error
Environment
latest, commit0d380afcd1feeb842c0c86290d46bcaf198cd5e4