Skip to content

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.

Unity Console showing multiple CS0246 errors

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 Assets and ProjectSettings folders.
  • 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.dll for scripts in the Assets folder root.
  • Assembly-CSharp-Editor.dll for scripts under Assets/Editor.
  • One named assembly per .asmdef file under Assets.

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.log

Open 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 codeError text (abridged)Typical causeResolution
CS0246The type or namespace name X could not be foundMissing assembly referenceMethod 1: Link Unturned runtime DLLs
CS0234The type or namespace name X does not exist in the namespace YOutdated reference to a renamed Unturned classMethod 2: Update class references
CS0117X does not contain a definition for YAPI surface changed in a newer Unturned releaseMethod 3: Update API call signatures
CS1061X does not contain a definition for Y and no accessible extension methodMethod or property renamed or movedMethod 3: Update API call signatures
CS0103The name X does not exist in the current contextMissing using directive or removed identifierMethod 4: Add or update using directives
CS0118X is a Y but used like a ZType name collision between two referenced assembliesMethod 5: Disambiguate type names
CS0433The type X exists in both A.dll and B.dllDuplicate DLL in projectMethod 6: Remove duplicate DLLs
CS1503Argument N cannot convert from X to YAPI signature changedMethod 3: Update API call signatures
CS0029Cannot implicitly convert type X to YAPI return type changedMethod 3: Update API call signatures
CS0535X does not implement interface member YInterface signature changed in newer Unturned releaseMethod 3: Update API call signatures
CS7069Reference to type X claims it is defined in A, but it could not be foundTransitive assembly reference missingMethod 7: Add transitive references
CS0227Unsafe code may only appear if compiling with /unsafeProject missing unsafe flagMethod 8: Enable unsafe code
CS8019Unnecessary using directiveWarning only; no action requiredNone

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 countProbable underlying cause
1-3 errorsSingle small problem; address each error in turn
10-30 errors, all CS0246 for one namespaceSingle missing assembly reference
30-100 errors of mixed typesMissing or outdated Unturned runtime DLLs
100-500 errorsEditor has not finished compiling; wait for completion before diagnosing
500+ errorsCatastrophic 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

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:

DLLProvides
Assembly-CSharp.dllThe vast majority of Unturned game classes
Assembly-CSharp-firstpass.dllLower-level game classes loaded before Assembly-CSharp
SDG.NetTransport.dllNetworking transport layer
SDG.NetPak.Runtime.dllNetwork packet serialization
SDG.Unturned.dllSome Unturned-specific runtime helpers
UnityEngine.dllUnity engine surface
UnityEngine.CoreModule.dllUnity core module
com.rlabrecque.steamworks.net.dllSteamworks API wrapper used by Unturned

The steps to link these DLLs:

  1. Close Unity.
  2. In the project's Assets folder, create a Plugins subfolder if one does not already exist.
  3. Copy the required DLLs from the Unturned managed folder into Assets/Plugins.
  4. Open Unity. The editor will detect the new DLLs and import them.
  5. 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).
  6. 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.

  1. Read the first CS0234 error in the Console. Note the namespace and type name the compiler cannot find.
  2. Open the Unturned modding documentation at the Smartly Dressed Games site to confirm the class's current namespace.
  3. If the class was renamed, the documentation typically notes the rename. If the class was moved, the documentation lists the new namespace.
  4. 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.
  5. 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.

  1. Read the first error in the Console. Note the method or property name and the type that hosts it.
  2. 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.
  3. Update the call site to match the new signature: add or remove arguments, adjust the argument types, or change the return-value handling.
  4. 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.

  1. Read the CS0103 error in the Console. Note the identifier name.
  2. Determine which namespace the identifier belongs to. The Unturned modding documentation lists the namespace for each public class.
  3. Open the source file in the editor or in Notepad++.
  4. Add a using directive at the top of the file: using SDG.Unturned; or the appropriate namespace.
  5. 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.

  1. Identify which two assemblies both define the conflicting type.
  2. In the source file, replace the bare type reference with the fully qualified reference: SDG.Unturned.Player rather than Player.
  3. 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;
  4. 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.

  1. Read the CS0433 error to identify the two DLLs.
  2. Determine which DLL the mod actually depends on. The other should be removed.
  3. Close Unity.
  4. Delete the unwanted DLL from Assets/Plugins.
  5. 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.

  1. Read the CS7069 error to identify the missing DLL.
  2. Locate the DLL in the Unturned managed folder or in the third-party tool's installation folder.
  3. Copy the DLL into Assets/Plugins.
  4. 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.

  1. In Unity, navigate to Edit → Project Settings → Player.
  2. Scroll to the "Other Settings" section.
  3. Check "Allow 'unsafe' Code."
  4. Click Apply.
  5. 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 ConsoleMost likely causeRemedy
Dozens of CS0246 for SDG.UnturnedMissing Unturned runtime DLLsMethod 1
Single CS0234 for a specific classClass renamed in newer Unturned releaseMethod 2
Mixed CS0117 and CS1061 errorsMultiple API signatures changedMethod 3
CS0103 for Mathf or Vector3Missing using UnityEngine; directiveMethod 4
CS0118 for PlayerType-name collision between assembliesMethod 5
CS0433 for a common typeDuplicate DLL in Assets/PluginsMethod 6
CS7069 for a Steamworks typeMissing Steamworks transitive referenceMethod 7
CS0227 after copying code from elsewhereProject not configured for unsafe codeMethod 8

Project window showing Assets/Plugins folder

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:

ErrorCauseResolution
"Bundle build failed: scripts not in build target"Mod scripts not flagged for the bundle's target platformMethod B1: Set platform flags
"Cannot include script X in bundle"Script references an editor-only APIMethod B2: Move editor-only code out of bundle scripts
"Asset X was modified during the build"A file watcher changed the asset mid-buildMethod B3: Pause file watchers
"Unable to resolve reference to X"Bundle has stale reference to a renamed assetMethod B4: Re-link bundle references
"Target platform not supported by Unity install"Build target module not installed via Unity HubMethod B5: Install platform support

Method B1: Set platform flags on bundle scripts

  1. In the Project window, select the script the bundle build is rejecting.
  2. In the Inspector, scroll to the "Select platforms for plugin" section if it appears.
  3. Confirm the platform the bundle targets (typically Standalone) is checked.
  4. Click Apply.
  5. 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.

  1. Read the bundle error to identify the script and the editor-only API.
  2. 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.
  3. 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."

  1. Close every external tool that watches the project folder.
  2. Pause cloud sync clients (OneDrive, Google Drive, Dropbox) for the duration of the build.
  3. Pause source-control GUI tools that auto-fetch.
  4. Rebuild the bundle.
  5. Resume the external tools after the build completes.

If the bundle has stale references to renamed or moved assets, rebuild the bundle from a clean state.

  1. Delete the bundle output folder (typically Assets/Bundles or similar).
  2. Delete the project's Library/AssetBundleCache folder if it exists.
  3. Open Unity and let it re-index.
  4. 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."

  1. Open Unity Hub.
  2. Select Installs in the left sidebar.
  3. Locate the editor version the project uses.
  4. Click the gear icon and select "Add modules."
  5. Check the missing platform support (e.g., Mac Build Support, Linux Build Support).
  6. Click Continue and wait for the install.
  7. 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

MethodTime requiredRisk levelFrequency in cohort survey
1. Link Unturned runtime DLLs5-10 minutesLowVery high
2. Update class references5-30 minutesMediumHigh (after game updates)
3. Update API signatures10-60 minutesMediumHigh (after game updates)
4. Add using directives2 minutesLowHigh
5. Disambiguate type names5 minutesLowLow
6. Remove duplicate DLLs5 minutesMediumMedium
7. Add transitive references5 minutesLowMedium
8. Enable unsafe code2 minutesLowLow
B1. Set platform flags2 minutesLowMedium
B2. Split editor and runtime code10-30 minutesMediumMedium
B3. Pause file watchers2 minutesLowLow
B4. Re-link bundle references10 minutesLowMedium
B5. Install platform support5-15 minutesLowLow

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.

  1. Open the .asmdef file in the Inspector.
  2. Scroll to the "Assembly Definition References" section.
  3. Add the required Unturned DLLs as references.
  4. Click Apply.
  5. 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.

  1. Open Edit → Project Settings → Player.
  2. Scroll to "Other Settings" and locate the "API Compatibility Level" dropdown.
  3. Match the API level used by Unturned. As of recent Unturned releases, the level is .NET Framework.
  4. Click Apply.
  5. 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.

  1. Open Edit → Project Settings → Player.
  2. Locate the "Scripting Backend" dropdown.
  3. Select Mono.
  4. Click Apply.
  5. 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.log

The 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.

  1. Close Unity.
  2. Delete the Library folder, the obj folder, and the Temp folder.
  3. Open Unity. The editor will rebuild the asset database and re-invoke the compiler on every script.
  4. Wait for compilation to finish. A full recompile of an Unturned mod typically takes 5-20 minutes depending on script count.
  5. 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/Plugins clean: only the DLLs the project actually depends on, no duplicates, no leftovers from previous experiments.
  • Maintain a README.md in 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 Library folder out of source control.
  • Use .asmdef files 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

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.

CodeOne-line descriptionResolution method
CS0029Cannot implicitly convert typeMethod 3
CS0103Name does not exist in contextMethod 4
CS0117Type does not contain a definitionMethod 3
CS0118Type used like a different kind of typeMethod 5
CS0227Unsafe code requires /unsafeMethod 8
CS0234Namespace does not containMethod 2
CS0246Type or namespace not foundMethod 1 or 4
CS0433Type exists in two DLLsMethod 6
CS0535Does not implement interface memberMethod 3
CS1061No accessible extension methodMethod 3
CS1503Argument cannot convertMethod 3
CS7069Reference claims type existsMethod 7
CS8019Unnecessary using directiveNone (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 errorEditor log signature
CS0246error CS0246: The type or namespace name
CS0234error CS0234: The type or namespace name
CS0117error CS0117:
CS0103error CS0103: The name
CS0433error CS0433:
Bundle build failedBuildPipeline 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.