Skip to content
Loadout

Fix

Unity 6 .meta files and dotnet build

Answer

Never delete, rename, or hand-edit a Unity .meta file. Unity stores the asset GUID there. Deleting one reimports the asset and breaks every reference to it. Do not run dotnet build to check a Unity project. The editor compiles assemblies itself. A bare dotnet build fails or compiles the wrong set of asmdefs.

  • Unity 6.3 LTS (6000.3.x), APIs checked against 6000.6 docs on 2026-10-15
  • Input System com.unity.inputsystem (Unity 6 new-project default)

Last verified 2026-10-15

The Unity 6 pack pins Unity 6.3 LTS (6000.3.x), APIs checked against 6000.6 docs on 2026-10-15. The pack says it also stops the two Unity-specific footguns, deleting .meta files and running dotnet build. FindObjectOfType is /fixes/unity-6-findobjectoftype-obsolete. Input.GetAxis is /fixes/unity-6-input-system-vs-input. This page is the project-files section of the same rules file. Do not emit Unity 2022 or earlier APIs.

Never delete, rename, or hand-edit a .meta file. Unity stores the asset GUID there. Deleting one reimports the asset and breaks every reference to it. Leave the .meta file next to the asset. Edit scripts under Assets/. Do not write into Library/, Temp/, Obj/, or Logs/.

Do not run dotnet build to check a Unity project. The editor compiles assemblies itself. A bare dotnet build fails or compiles the wrong set of asmdefs. The done checklist is the Console, not a dotnet command: the Console shows no compile errors after the editor recompiles, no obsolete-API warnings were introduced (FindObjectOfType, velocity, Input.*), and you said whether Play Mode was actually tested.

Do not write YAML into .unity, .prefab, or .asset files by hand. Change them in the editor or through an editor script. Load scenes by name or build index with SceneManager.LoadSceneAsync. Add the scene to the build profile first. Instantiate prefabs from a serialized reference, not Resources.Load, unless the project already uses Resources. Prefer a [SerializeField] reference over any Find call, and expose designer fields with [SerializeField] private.

Last verified 2026-10-15. doc-verified.

Unity 6 pack — Unity 6 C# rules that avoid the obsolete 2022 APIs.

doc-verified

Sources in the pack

Questions

Why did deleting a .meta file break my Unity project?
Never delete, rename, or hand-edit a Unity .meta file. Unity stores the asset GUID there. Deleting one reimports the asset and breaks every reference to it. Do not run dotnet build to check a Unity project. The editor compiles assemblies itself. A bare dotnet build fails or compiles the wrong set of asmdefs.
Why does dotnet build fail on a Unity project?
Do not run dotnet build to check a Unity project. The editor compiles assemblies itself. A bare dotnet build fails or compiles the wrong set of asmdefs. Read the Console after the editor recompiles.
Can I edit Unity .unity or .prefab files by hand?
No. Do not write YAML into .unity, .prefab, or .asset files by hand. Change them in the editor or through an editor script.
When was this Unity project-files rule last checked?
Last verified 2026-10-15. doc-verified.