Unity Compiler Errors
A modder finishes a coding session on an Unturned™ mod, switches focus back to the Unity editor, and sees a red banner at the bottom of the screen with a count of compilation errors. The Console window fills with CS0246, CS0234, CS0117, or any of two dozen other CS##### codes. The Play button is disabled. The build pipeline cannot produce a master bundle. Until the errors are resolved, the editor is essentially read-only.
This article documents the compiler errors that appear most often during Unturned mod development, identifies the root cause for each, and provides a resolution. The errors covered fall into four categories: missing assembly references, namespace and type-name drift between Unturned releases, build-target configuration issues, and asset-bundle-specific compilation failures. Every category has a distinct cause and a distinct fix; identifying the category from the error code is the first diagnostic step.

Prerequisites
- Unity editor open with the failing project.
- Notepad++ or another text editor installed for reading the editor log.
- The Unturned installation folder accessible (typically
C:\Program Files (x86)\Steam\steamapps\common\Unturned\). - The mod's source repository checked out at the version the modder is trying to compile.
- A backup of the project folder, or at minimum a backup of the
AssetsandProjectSettingsfolders. - Administrator access to the computer for some resolution methods.
What you'll learn
- How to read a Unity compiler error message and identify the failing assembly reference.
- How to locate Unturned's runtime DLLs and link them into a Unity project.
- How to interpret the most common
CS#####codes that appear during Unturned mod development. - How to read the Unity editor log to find errors the Console window does not display.
- How to handle assembly-resolution failures that surface only at master-bundle build time.
- How to recover from a partial recompile that leaves the project in a half-broken state.
- How to verify that the project's target framework matches the Unturned runtime.
- How to avoid the recurring failure modes that produce repeat compile errors after every Unturned game update.
Background: how Unity compiles C# scripts
The Unity editor runs a C# compiler internally. Every time a script file changes, the editor invokes the compiler to produce assemblies (.dll files) that the editor then loads. The compilation produces three principal assemblies for a typical Unturned mod:
Assembly-CSharp.dllfor scripts in theAssetsfolder root.Assembly-CSharp-Editor.dllfor scripts underAssets/Editor.- One named assembly per
.asmdeffile underAssets.
Each assembly has its own list of references. A reference is either to a Unity built-in module, to a third-party DLL stored in the project, or to a separate .asmdef in the same project. When the compiler cannot resolve a reference, it produces CS0246 (type or namespace not found) for every line that depends on the missing reference. A single missing reference can produce dozens of errors in the Console; the count of errors does not reflect the count of underlying problems.
The sequence diagram above models the compilation pipeline. A failure at any step produces a distinct error signature in the Console window; identifying the failing step narrows the resolution to one or two methods.
Where to find the editor log
The editor log records every compilation attempt, including failures the Console window cannot display because the editor was unable to fully initialize. On Windows the log is at:
%LOCALAPPDATA%\Unity\Editor\Editor.logOpen the log in Notepad++ and scroll to the end. The last 100 lines describe the most recent compilation result. Search the file (Ctrl+F) for error CS to jump to the first compiler error of the session.
Did you know?
The editor log is overwritten on every Unity launch. To preserve a log from a failed compilation, copy the file to a backup location before launching the editor again.
Error code reference
The table below documents the C# compiler error codes that appear most often during Unturned mod development. Each row links the error code to the typical cause and the resolution method documented later in this article.
| Error code | Error text (abridged) | Typical cause | Resolution |
|---|---|---|---|
| CS0246 | The type or namespace name X could not be found | Missing assembly reference | Method 1: Link Unturned runtime DLLs |
| CS0234 | The type or namespace name X does not exist in the namespace Y | Outdated reference to a renamed Unturned class | Method 2: Update class references |
| CS0117 | X does not contain a definition for Y | API surface changed in a newer Unturned release | Method 3: Update API call signatures |
| CS1061 | X does not contain a definition for Y and no accessible extension method | Method or property renamed or moved | Method 3: Update API call signatures |
| CS0103 | The name X does not exist in the current context | Missing using directive or removed identifier | Method 4: Add or update using directives |
| CS0118 | X is a Y but used like a Z | Type name collision between two referenced assemblies | Method 5: Disambiguate type names |
| CS0433 | The type X exists in both A.dll and B.dll | Duplicate DLL in project | Method 6: Remove duplicate DLLs |
| CS1503 | Argument N cannot convert from X to Y | API signature changed | Method 3: Update API call signatures |
| CS0029 | Cannot implicitly convert type X to Y | API return type changed | Method 3: Update API call signatures |
| CS0535 | X does not implement interface member Y | Interface signature changed in newer Unturned release | Method 3: Update API call signatures |
| CS7069 | Reference to type X claims it is defined in A, but it could not be found | Transitive assembly reference missing | Method 7: Add transitive references |
| CS0227 | Unsafe code may only appear if compiling with /unsafe | Project missing unsafe flag | Method 8: Enable unsafe code |
| CS8019 | Unnecessary using directive | Warning only; no action required | None |
Identifying the root cause from the error count
The number of compiler errors in the Console window correlates with the number of underlying problems in a predictable pattern.
| Error count | Probable underlying cause |
|---|---|
| 1-3 errors | Single small problem; address each error in turn |
10-30 errors, all CS0246 for one namespace | Single missing assembly reference |
| 30-100 errors of mixed types | Missing or outdated Unturned runtime DLLs |
| 100-500 errors | Editor has not finished compiling; wait for completion before diagnosing |
| 500+ errors | Catastrophic reference failure; entire Assets/Plugins folder may be missing |
The cohort-validated diagnostic flow is to count the errors first, then read the first three errors in detail, then locate the underlying cause. Reading errors 10-200 is unproductive because they are typically duplicates of the first three.
Diagnostic flow
Resolution methods
Method 1: Link Unturned runtime DLLs
Most CS0246 errors during Unturned mod development trace to a missing reference to one of Unturned's runtime DLLs. The mod's scripts reference types defined in those DLLs; without the reference, the compiler cannot resolve the types.
The DLLs are shipped with Unturned itself. On Windows the typical location is:
C:\Program Files (x86)\Steam\steamapps\common\Unturned\Unturned_Data\Managed\The folder contains several dozen DLLs. The ones most commonly needed for mod development are:
| DLL | Provides |
|---|---|
Assembly-CSharp.dll | The vast majority of Unturned game classes |
Assembly-CSharp-firstpass.dll | Lower-level game classes loaded before Assembly-CSharp |
SDG.NetTransport.dll | Networking transport layer |
SDG.NetPak.Runtime.dll | Network packet serialization |
SDG.Unturned.dll | Some Unturned-specific runtime helpers |
UnityEngine.dll | Unity engine surface |
UnityEngine.CoreModule.dll | Unity core module |
com.rlabrecque.steamworks.net.dll | Steamworks API wrapper used by Unturned |
The steps to link these DLLs:
- Close Unity.
- In the project's
Assetsfolder, create aPluginssubfolder if one does not already exist. - Copy the required DLLs from the Unturned managed folder into
Assets/Plugins. - Open Unity. The editor will detect the new DLLs and import them.
- In the Project window, select each DLL in turn. In the Inspector, confirm that the platform settings include the target platforms the mod supports (Editor, Standalone).
- Retry compilation.
Common mistake
Copying the entire Managed folder into the project. The Managed folder contains DLLs for the Unity engine itself, which conflict with the Unity engine DLLs the editor is already loading. Copy only the Unturned-specific and third-party DLLs listed above; do not copy UnityEngine.dll, mscorlib.dll, or System.*.dll.
Method 2: Update class references after a renamed Unturned class
Smartly Dressed Games occasionally renames or relocates classes between Unturned releases. A mod that compiled against the previous release fails to compile against the new release with CS0234 errors pointing at the moved class.
The resolution is to identify the new class name and update the mod's references.
- Read the first
CS0234error in the Console. Note the namespace and type name the compiler cannot find. - Open the Unturned modding documentation at the Smartly Dressed Games site to confirm the class's current namespace.
- If the class was renamed, the documentation typically notes the rename. If the class was moved, the documentation lists the new namespace.
- Use the editor's Find in Files (Ctrl+Shift+F) to locate every reference to the old name in the project. Update each reference to the new name.
- Retry compilation.
Pro tip
A bulk find-and-replace across the project's Assets folder can save time when an Unturned release renames many classes at once. Always commit the project to source control before running a bulk replace; the operation is hard to reverse if it goes wrong.
Method 3: Update API call signatures
CS0117, CS1061, CS1503, CS0029, and CS0535 errors typically indicate that an API surface has changed. A method signature, return type, or interface contract differs from what the mod expects.
The resolution is to read the new signature and update the mod's call sites.
- Read the first error in the Console. Note the method or property name and the type that hosts it.
- Use the Unity editor's Go to Definition feature (F12 with the cursor on the call site in Visual Studio or Rider) to inspect the method's new signature.
- Update the call site to match the new signature: add or remove arguments, adjust the argument types, or change the return-value handling.
- Retry compilation.
If the editor cannot resolve Go to Definition because the DLL is not visible in the project, see Method 1 (linking Unturned runtime DLLs).
Method 4: Add or update using directives
CS0103 errors indicate that an identifier (a class name, method name, or constant) cannot be resolved in the current context. The most common cause is a missing using directive at the top of the source file.
- Read the
CS0103error in the Console. Note the identifier name. - Determine which namespace the identifier belongs to. The Unturned modding documentation lists the namespace for each public class.
- Open the source file in the editor or in Notepad++.
- Add a
usingdirective at the top of the file:using SDG.Unturned;or the appropriate namespace. - Retry compilation.
If the identifier was renamed (not just relocated), the CS0103 will not resolve with a new using directive. In that case proceed to Method 2 or Method 3.
Method 5: Disambiguate type names
CS0118 indicates that the compiler has matched the type name but the match is unexpected. The most common cause is that two referenced assemblies define a type with the same name in the same namespace.
The resolution is to qualify the type name with the full assembly path or to add an extern alias.
- Identify which two assemblies both define the conflicting type.
- In the source file, replace the bare type reference with the fully qualified reference:
SDG.Unturned.Playerrather thanPlayer. - If both assemblies use the same fully qualified name (rare but possible), add an extern alias at the top of the source file:csharp
extern alias UnturnedAssembly; using UnturnedPlayer = UnturnedAssembly::SDG.Unturned.Player; - Retry compilation.
Method 6: Remove duplicate DLLs
CS0433 indicates that the compiler has found the same type defined in two different DLLs that are both referenced. The resolution is to remove one of the DLLs from the project.
- Read the
CS0433error to identify the two DLLs. - Determine which DLL the mod actually depends on. The other should be removed.
- Close Unity.
- Delete the unwanted DLL from
Assets/Plugins. - Open Unity and retry compilation.
Critical warning
Removing the wrong DLL produces a cascade of CS0246 errors. Confirm which DLL the mod depends on before deleting either one. The cohort recommendation is to make a backup copy of the Assets/Plugins folder before removing any DLL.
Method 7: Add transitive references
CS7069 indicates that the compiler has resolved a direct reference but cannot find a transitive reference (a DLL that the direct reference itself depends on). The resolution is to add the transitive reference to the project.
- Read the
CS7069error to identify the missing DLL. - Locate the DLL in the Unturned managed folder or in the third-party tool's installation folder.
- Copy the DLL into
Assets/Plugins. - Retry compilation.
Method 8: Enable unsafe code
CS0227 indicates that the source file uses the unsafe keyword but the project is not configured to allow unsafe code. The resolution is to enable unsafe code in the project settings.
- In Unity, navigate to Edit → Project Settings → Player.
- Scroll to the "Other Settings" section.
- Check "Allow 'unsafe' Code."
- Click Apply.
- Retry compilation.
The cohort recommendation is to avoid unsafe code in mod projects when possible. Unturned's own scripts rarely require unsafe and the mod's APIs typically do not need it. Only enable the flag when a specific dependency requires it.
Cause and remedy summary
The table below maps the most frequently observed error patterns to causes and remedies. The table is the cohort's first-pass triage chart.
| Pattern in Console | Most likely cause | Remedy |
|---|---|---|
Dozens of CS0246 for SDG.Unturned | Missing Unturned runtime DLLs | Method 1 |
Single CS0234 for a specific class | Class renamed in newer Unturned release | Method 2 |
Mixed CS0117 and CS1061 errors | Multiple API signatures changed | Method 3 |
CS0103 for Mathf or Vector3 | Missing using UnityEngine; directive | Method 4 |
CS0118 for Player | Type-name collision between assemblies | Method 5 |
CS0433 for a common type | Duplicate DLL in Assets/Plugins | Method 6 |
CS7069 for a Steamworks type | Missing Steamworks transitive reference | Method 7 |
CS0227 after copying code from elsewhere | Project not configured for unsafe code | Method 8 |

Asset bundle compile errors
Asset bundles (master bundles in Unturned terminology) are a separate compile path. A script can compile successfully into Assembly-CSharp.dll and still fail when the asset bundle is built. The typical symptom is a Console error during the bundle build step that does not appear in the normal compile pass.
The cohort-recognised asset-bundle compile errors:
| Error | Cause | Resolution |
|---|---|---|
| "Bundle build failed: scripts not in build target" | Mod scripts not flagged for the bundle's target platform | Method B1: Set platform flags |
"Cannot include script X in bundle" | Script references an editor-only API | Method B2: Move editor-only code out of bundle scripts |
"Asset X was modified during the build" | A file watcher changed the asset mid-build | Method B3: Pause file watchers |
"Unable to resolve reference to X" | Bundle has stale reference to a renamed asset | Method B4: Re-link bundle references |
| "Target platform not supported by Unity install" | Build target module not installed via Unity Hub | Method B5: Install platform support |
Method B1: Set platform flags on bundle scripts
- In the Project window, select the script the bundle build is rejecting.
- In the Inspector, scroll to the "Select platforms for plugin" section if it appears.
- Confirm the platform the bundle targets (typically Standalone) is checked.
- Click Apply.
- Rebuild the bundle.
Method B2: Move editor-only code out of bundle scripts
Editor-only code (anything inside #if UNITY_EDITOR or under Assets/Editor) cannot be included in a runtime asset bundle.
- Read the bundle error to identify the script and the editor-only API.
- Move the editor-only API out of the script. If the script contains both runtime and editor-only code, split the file: keep the runtime code in the original file, move the editor-only code into a new file under
Assets/Editor. - Rebuild the bundle.
Method B3: Pause file watchers during bundle build
External file watchers (cloud sync clients, source-control GUI tools, IDE indexers) occasionally modify a file mid-build. The build fails with "Asset X was modified during the build."
- Close every external tool that watches the project folder.
- Pause cloud sync clients (OneDrive, Google Drive, Dropbox) for the duration of the build.
- Pause source-control GUI tools that auto-fetch.
- Rebuild the bundle.
- Resume the external tools after the build completes.
Method B4: Re-link bundle references
If the bundle has stale references to renamed or moved assets, rebuild the bundle from a clean state.
- Delete the bundle output folder (typically
Assets/Bundlesor similar). - Delete the project's
Library/AssetBundleCachefolder if it exists. - Open Unity and let it re-index.
- Rebuild the bundle.
Method B5: Install platform support
If the bundle targets a platform whose Unity module is not installed (StandaloneOSX, StandaloneLinux64), the bundle build fails with "Target platform not supported by Unity install."
- Open Unity Hub.
- Select Installs in the left sidebar.
- Locate the editor version the project uses.
- Click the gear icon and select "Add modules."
- Check the missing platform support (e.g., Mac Build Support, Linux Build Support).
- Click Continue and wait for the install.
- Return to the editor and rebuild the bundle.
For details on the master-bundle export workflow itself, refer to Master Bundle Export.
Did you know?
Unity's asset-bundle pipeline performs its own compilation of any scripts the bundle includes. The bundle compile is separate from the editor compile and can fail even when the editor compile succeeded. The bundle compile uses the Standalone target by default, which is the correct target for Unturned mods.
Method comparison
| Method | Time required | Risk level | Frequency in cohort survey |
|---|---|---|---|
| 1. Link Unturned runtime DLLs | 5-10 minutes | Low | Very high |
| 2. Update class references | 5-30 minutes | Medium | High (after game updates) |
| 3. Update API signatures | 10-60 minutes | Medium | High (after game updates) |
| 4. Add using directives | 2 minutes | Low | High |
| 5. Disambiguate type names | 5 minutes | Low | Low |
| 6. Remove duplicate DLLs | 5 minutes | Medium | Medium |
| 7. Add transitive references | 5 minutes | Low | Medium |
| 8. Enable unsafe code | 2 minutes | Low | Low |
| B1. Set platform flags | 2 minutes | Low | Medium |
| B2. Split editor and runtime code | 10-30 minutes | Medium | Medium |
| B3. Pause file watchers | 2 minutes | Low | Low |
| B4. Re-link bundle references | 10 minutes | Low | Medium |
| B5. Install platform support | 5-15 minutes | Low | Low |
Advanced considerations
Per-assembly references via .asmdef files
A Unity project that uses Assembly Definition (.asmdef) files has fine-grained control over which scripts reference which assemblies. The default reference set excludes any DLL not explicitly listed. If a mod has migrated to .asmdef files, the runtime DLLs from Method 1 must also be listed in each relevant .asmdef's reference list.
- Open the
.asmdeffile in the Inspector. - Scroll to the "Assembly Definition References" section.
- Add the required Unturned DLLs as references.
- Click Apply.
- Retry compilation.
Mismatched .NET API levels
Unity supports two .NET API levels: .NET Standard 2.1 and .NET Framework. Unturned scripts target a specific API level, and a mismatched API level produces CS0234 and CS0117 errors for types that should exist.
- Open Edit → Project Settings → Player.
- Scroll to "Other Settings" and locate the "API Compatibility Level" dropdown.
- Match the API level used by Unturned. As of recent Unturned releases, the level is
.NET Framework. - Click Apply.
- Retry compilation.
Mono vs IL2CPP scripting backend
Unturned ships with the Mono scripting backend. Mods compiled against IL2CPP do not load. If the project's scripting backend is IL2CPP, switch back to Mono.
- Open Edit → Project Settings → Player.
- Locate the "Scripting Backend" dropdown.
- Select Mono.
- Click Apply.
- Retry compilation.
Reading the bundle build log
The bundle build log is separate from the editor log. On Windows the bundle build log is at:
%LOCALAPPDATA%\Unity\Editor\Editor.logThe bundle build messages appear at the end of the file, prefixed with "Building bundle" or "BuildPipeline." Search for those strings to jump to the relevant section.
Recompile from scratch
If the project's compile state has become inconsistent (some assemblies updated, others not), a full recompile from scratch is the safest reset.
- Close Unity.
- Delete the
Libraryfolder, theobjfolder, and theTempfolder. - Open Unity. The editor will rebuild the asset database and re-invoke the compiler on every script.
- Wait for compilation to finish. A full recompile of an Unturned mod typically takes 5-20 minutes depending on script count.
- Read the Console for any remaining errors.
The full recompile is the cohort's last-resort method for compile-state inconsistencies. The downside is the time cost; the upside is that no remnant of the previous compile state can produce stale errors.
Common mistake
Deleting the Assets folder rather than the Library folder. The Assets folder contains every modder-authored script. Deleting it deletes the project's source code. Confirm the folder name before deleting anything.
Frequently asked questions
What does CS0246 mean specifically?
CS0246 is "The type or namespace name X could not be found (are you missing a using directive or an assembly reference?)." The compiler has encountered an identifier it cannot resolve to a known type. In Unturned mod work the cause is almost always a missing assembly reference; in non-Unturned C# code the cause is more often a missing using directive. Try Method 4 (using directive) first if the missing identifier is a Unity built-in like Mathf; try Method 1 (link runtime DLLs) if the identifier is in the SDG.Unturned namespace.
Why do my errors disappear and reappear after every Unturned game update?
Unturned updates ship new versions of Assembly-CSharp.dll and related runtime DLLs. If the mod project references the older DLLs from a local copy, the older DLLs remain unchanged when Unturned updates. The mod still compiles against the old API surface, even though the live game has moved on. The reverse pattern (DLLs auto-updated, mod source not updated) produces fresh CS0234 and CS0117 errors on every game update.
The cohort recommendation is to re-copy the Unturned runtime DLLs into the project's Assets/Plugins folder after every Unturned game update, and to update the mod's source to match any API changes. The cohort case study program documents this as the single most common cause of repeat compile errors.
My Console shows 500 errors. Where do I start?
Start with the first error. The first three errors are typically the only ones that matter; the rest are duplicates or cascades. A common cause of a 500-error count is a single missing assembly reference; once that reference is added, the count drops to zero or single digits.
How do I add a DLL reference?
In Unity, drag the DLL into Assets/Plugins. The editor auto-detects the DLL and makes it available to scripts in the project. If the DLL needs to be referenced from a .asmdef assembly, the DLL must additionally be added to the .asmdef's reference list (see Advanced considerations).
Why does the compiler say a type exists in two DLLs?
CS0433 indicates that two referenced DLLs both define a type with the same fully qualified name. The cause is almost always a duplicate DLL: the same DLL has been copied into Assets/Plugins under two different names, or the project references both the original DLL and a forked or stripped version of the same DLL. Remove one of the DLLs to resolve the conflict (Method 6).
Can I share my Plugins folder between multiple mod projects?
Yes, with caveats. The standard approach is to keep a single copy of the Unturned runtime DLLs in a known location and reference it via .asmdef from each project. The risk is that the shared copy must be kept in sync with the Unturned releases all the dependent mods target; if a single shared copy serves multiple mods that target different Unturned releases, the copy is wrong for at least one of them. The cohort recommendation is to keep a per-project Plugins folder unless the modder is sure every dependent project targets the same Unturned release.
What is the editor log and how does it differ from the Console?
The Console window displays the most recent compilation result and runtime errors in a structured UI. The editor log is the underlying file the editor writes to disk; it records every action the editor takes, including actions that occurred before the Console was ready to display them. The editor log contains more detail than the Console and persists across editor sessions (though it is overwritten on each launch). The cohort recommendation is to use the Console for quick triage and the editor log for deeper diagnosis.
How do I tell which Unity version Unturned expects?
Smartly Dressed Games publishes the required Unity editor version on the official modding documentation. The version is updated when Smartly Dressed Games migrates the game to a new Unity release. Confirm the required version before starting any new mod project; using a different version produces both the compile errors documented in this article and the project-open errors documented in Unity Won't Open My Project.
Will my master bundle compile if my scripts have errors?
No. The bundle build requires that all scripts in the project compile successfully into Assembly-CSharp.dll before the bundle build proceeds. A single compile error in any script blocks the bundle build for every asset in the project, even assets that do not depend on the failing script. The resolution is to fix every compile error before attempting a bundle build; see Master Bundle Export for the bundle build workflow itself.
Why did my project compile yesterday and fail today with no source changes?
The most common causes of overnight compile failures with no source changes are: Unturned updated, replacing the runtime DLLs the project references; Unity Hub updated, switching the default editor version to a newer release that handles some warning as an error; an antivirus update quarantined a referenced DLL; Windows Update changed file permissions on the Plugins folder. Inspect the editor log to identify which step now fails, and consult the cause-and-remedy summary table for the matching remedy.
Can I keep modding while the Console shows errors?
The editor blocks the Play button and the build pipeline while compile errors are present. Asset editing (textures, prefabs, scenes) still works; script editing also works. The cohort recommendation is to resolve compile errors as soon as they appear, because subsequent script changes layered on top of a broken compile state are difficult to diagnose later.
What does "namespace does not exist" mean if the namespace is right there in another file?
CS0234 typically indicates that the compiler is reading a using directive (or fully qualified reference) that references a namespace it cannot find in any referenced assembly. The namespace may exist in the project's source files, but the source files themselves must compile into an assembly the dependent file references. If the namespace is defined in a file under a different .asmdef, the dependent .asmdef must list the source .asmdef as a reference.
Best practices
- Re-copy Unturned runtime DLLs after every Unturned game update.
- Commit the project to source control before any bulk find-and-replace.
- Keep
Assets/Pluginsclean: only the DLLs the project actually depends on, no duplicates, no leftovers from previous experiments. - Maintain a
README.mdin the project root that lists the Unturned release the project targets and the editor version the project requires. - Read the first three Console errors carefully; treat the rest as duplicates until proven otherwise.
- Keep the bundle output folder and the
Libraryfolder out of source control. - Use
.asmdeffiles for any project with more than 50 scripts; the compile speed improvement is substantial and the explicit reference list catches some classes of errors earlier. - Confirm the .NET API level and the scripting backend match Unturned's expectations on every new project setup.
Cross-references
- Unity Won't Open My Project — diagnostic flow for the broader project-open failure, including the editor-log analysis approach used in this article.
- Mod Not Loading — the next article in the troubleshooting section, which addresses the case where the mod compiles successfully but fails to load at runtime.
- How to Install Unity Editor — installation guide for the editor and Hub.
- Master Bundle Export — the bundle-export workflow that compile errors block.
- Project Folder Structure and GUIDs — the folder structure compile errors most often surface within.
- Items Missing in Game — sibling troubleshooting article for the case where the bundle builds but items do not appear in-game.
- Unity Asset Bundles Intro — Unity's official documentation on asset bundles, the build target for Unturned mod content.
- Smartly Dressed Games Modding Documentation — the official Unturned modding documentation, including the canonical class and namespace listings.
- Unturned on Steam — the game itself.
Appendix A: complete CS##### code reference
The table below documents every CS##### code the cohort has encountered during Unturned mod development. The codes the cohort has not encountered are omitted; the cohort survey suggests the omitted codes are sufficiently rare that the modder will resolve them by reading the error text rather than by consulting a reference.
| Code | One-line description | Resolution method |
|---|---|---|
| CS0029 | Cannot implicitly convert type | Method 3 |
| CS0103 | Name does not exist in context | Method 4 |
| CS0117 | Type does not contain a definition | Method 3 |
| CS0118 | Type used like a different kind of type | Method 5 |
| CS0227 | Unsafe code requires /unsafe | Method 8 |
| CS0234 | Namespace does not contain | Method 2 |
| CS0246 | Type or namespace not found | Method 1 or 4 |
| CS0433 | Type exists in two DLLs | Method 6 |
| CS0535 | Does not implement interface member | Method 3 |
| CS1061 | No accessible extension method | Method 3 |
| CS1503 | Argument cannot convert | Method 3 |
| CS7069 | Reference claims type exists | Method 7 |
| CS8019 | Unnecessary using directive | None (warning) |
Appendix B: cohort case studies
Case study 1: the Unturned update that renamed Player
A long-tenure cohort member shipped a working item mod and went on holiday. While they were away, Smartly Dressed Games shipped a major Unturned update that renamed Player to UnturnedPlayer in several namespaces. When the modder returned and opened the project, the Console showed approximately 80 compile errors of type CS0234 for Player.
The fix was Method 2: a bulk find-and-replace across the project's Assets folder, replacing Player with UnturnedPlayer wherever it appeared as a type reference. The cohort recommendation that resulted from the case study is to read the Unturned release notes after every Unturned update and to allocate time to update mods against renamed APIs.
Case study 2: the duplicate Newtonsoft.Json DLL
A mid-tenure cohort member added a third-party library that bundled its own copy of Newtonsoft.Json.dll. The project's Assets/Plugins folder already contained a different version of the same DLL. The compile failed with CS0433 for several JSON-related types.
The fix was Method 6: identify which version of Newtonsoft.Json.dll the project actually depended on (the older version, because the third-party library claimed compatibility with both), then delete the newer DLL the third-party library had bundled. The cohort recommendation that resulted from the case study is to inspect any third-party library's contents before adding it to the project, and to consolidate DLLs to a single version where possible.
Case study 3: the IL2CPP misconfiguration
A new cohort member followed an online tutorial that mentioned IL2CPP as a performance optimization. They switched the scripting backend to IL2CPP. The mod compiled successfully into Assembly-CSharp.dll, but the master bundle build failed with errors that did not appear in the editor log.
The fix was a switch back to the Mono scripting backend (Advanced consideration). The cohort recommendation that resulted from the case study is to leave the scripting backend at the Unity default for Unturned modding, which is Mono.
Appendix C: editor log signatures for the common errors
Each compile error produces a distinct signature in the editor log. The signatures below can be used to identify the error without opening the Console window.
| Console error | Editor log signature |
|---|---|
| CS0246 | error CS0246: The type or namespace name |
| CS0234 | error CS0234: The type or namespace name |
| CS0117 | error CS0117: |
| CS0103 | error CS0103: The name |
| CS0433 | error CS0433: |
| Bundle build failed | BuildPipeline error or BuildAssetBundles error |
The signatures are useful when the editor crashes during compilation and the Console window is not available to read. Open the editor log in Notepad++ and search for the signature; the surrounding lines describe the specific failure.
Closing note
Compile errors are the most common modder-reported failure mode in the 57 Studios cohort survey, accounting for approximately 41 percent of all troubleshooting requests. The eight resolution methods documented in this article cover the overwhelming majority of cohort-reported compile errors; the five additional asset-bundle methods cover the bundle-specific subset.
A modder who internalises the error-code reference and the diagnostic flowchart can typically resolve a compile error within five to ten minutes from the first symptom. Resolution time increases when the underlying cause is a recent Unturned game update; in that case the work shifts from diagnosis (which is fast) to API migration (which can take hours). The cohort recommendation is to allocate time after every Unturned update for an API migration pass on the modder's active projects.
Next steps
If the mod compiles successfully but does not load in the game, continue to Mod Not Loading. Return to the section overview at Troubleshooting for a list of all articles in this section.
