Build server fails CS0246 on all game types due to IL2CPP native binaries in managed reference path.
Summary
The uMod build server is failing to compile ModernItemBlocker 4.1.4 with 18 CS0246 errors covering every Rust game type used by the plugin (BasePlayer, PlayerInventory, Item, BaseProjectile, IAmmoContainer, Planner, Construction). The root cause is not in the plugin source. The build server's managed reference set at references/rust/RustDedicated_Data/Managed/ contains native IL2CPP binaries where managed stub assemblies are expected, causing Assembly-CSharp.dll and Assembly-CSharp-firstpass.dll to be silently dropped from the compiler invocation. All 18 CS0246 errors are downstream consequences of that single missing reference.
Environment
| Field | Value |
|---|---|
| Rust update | Community Update 268 |
| Oxide version | 2.0.7182 |
| Build system | mono/msbuild with Roslyn csc |
| Target framework | .NET Framework 4.6 |
| Build configuration | Debug, Any CPU |
Failure Evidence
Step 1: ResolveAssemblyReferences phase
The build log shows System.BadImageFormatException on every DLL in the managed reference set, including the critical ones:
warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise
inaccessible. System.BadImageFormatException: Assembly file
"references/rust/RustDedicated_Data/Managed/Assembly-CSharp.dll" could not
be opened -- PE image doesn't contain managed metadata.
warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise
inaccessible. System.BadImageFormatException: Assembly file
"references/rust/RustDedicated_Data/Managed/Assembly-CSharp-firstpass.dll"
could not be opened -- PE image doesn't contain managed metadata.The phrase "PE image doesn't contain managed metadata" identifies these as native (IL2CPP-compiled) binaries. A managed stub DLL would contain MSIL type metadata readable by msbuild and Roslyn.
Step 2: CoreCompile phase
Scanning the csc.exe invocation in the build log confirms that Assembly-CSharp.dll and Assembly-CSharp-firstpass.dll are absent from the /reference: flags, despite being listed in ResolveAssemblyReferences. msbuild drops them because they failed to load. The compiler proceeds with no game type definitions.
Step 3: Compile errors
18 identical CS0246 errors result, all on types defined in Assembly-CSharp.dll:
ModernItemBlocker.cs(691,40): error CS0246: The type or namespace name 'BasePlayer' could not be found
ModernItemBlocker.cs(791,37): error CS0246: The type or namespace name 'PlayerInventory' could not be found
ModernItemBlocker.cs(791,64): error CS0246: The type or namespace name 'Item' could not be found
ModernItemBlocker.cs(847,41): error CS0246: The type or namespace name 'BaseProjectile' could not be found
ModernItemBlocker.cs(847,66): error CS0246: The type or namespace name 'IAmmoContainer' could not be found
ModernItemBlocker.cs(875,33): error CS0246: The type or namespace name 'Planner' could not be found
ModernItemBlocker.cs(875,50): error CS0246: The type or namespace name 'Construction' could not be found(plus 11 additional BasePlayer occurrences at other line numbers)
Cause
Rust Community Update 268 transitioned or updated the dedicated server to use IL2CPP-compiled game assemblies. Assembly-CSharp.dll in the current dedicated server package is a native binary, not a managed assembly. The uMod build server's managed reference set at references/rust/RustDedicated_Data/Managed/ has not been updated with regenerated managed stub DLLs that reflect the current game API. These stub DLLs (type signatures with no implementation body) are what allow the Roslyn compiler to resolve game types at compile time without needing the full native binary.
This is a build infrastructure issue, not a plugin source issue. The plugin source uses correct, unmodified Oxide hook signatures compatible with Oxide 2.0.7022 through 2.0.7182. No change to the plugin can work around a missing reference at the compiler level.
Impact
Any plugin that references game types defined in Assembly-CSharp.dll will fail with the same CS0246 pattern. This is expected to affect a large portion of the plugin catalog, not just ModernItemBlocker.
What is Not the Cause
- The plugin source code. All hook signatures are correct for the current Oxide API.
- A duplicate class definition (the CS0101 error seen in an earlier build against 4.1.1 was resolved in 4.1.3 by removing a root-level
.csfile). - A missing
usingdirective. All required Oxide namespaces are present.
Requested Action
Regenerate the managed stub DLLs in references/rust/RustDedicated_Data/Managed/ against the Rust Community Update 268 dedicated server package and redeploy the build server reference set. Once updated, a rebuild of ModernItemBlocker 4.1.4 from the current GitHub main branch (7e6348891558fc1a0620dd43e1d0bd35ccc1772e) should succeed without any changes to the plugin source.
Plugin Repository
https://github.com/gjdunga/ModernItemBlocker
Current main commit:7e6348891558fc1a0620dd43e1d0bd35ccc1772eTag:4.1.4