{"record":{"id":"42177dc281685fe9","repo":"Unity-Technologies/UnityCsReference","slug":"unknown-dll-type-0","errorCode":null,"errorMessage":"Unknown dll type: {0}","messagePattern":"Unknown dll type: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Editor/Mono/InternalEditorUtility.bindings.cs","lineNumber":1159,"sourceCode":"        [FreeFunction]\n        internal static extern bool IsDotNetDll(string path);\n\n        public static bool IsDotNet4Dll(string path)\n        {\n            var dllType = DetectDotNetDll(path);\n            switch (dllType)\n            {\n                case UnityEditorInternal.DllType.Unknown:\n                case UnityEditorInternal.DllType.Native:\n                case UnityEditorInternal.DllType.UnknownManaged:\n                case UnityEditorInternal.DllType.ManagedNET35:\n                    return false;\n                case UnityEditorInternal.DllType.ManagedNET40:\n                case UnityEditorInternal.DllType.WinMDNative:\n                case UnityEditorInternal.DllType.WinMDNET40:\n                    return true;\n                default:\n                    throw new Exception(string.Format(\"Unknown dll type: {0}\", dllType));\n            }\n        }\n\n        internal static bool RunningUnderWindows8(bool orHigher = true)\n        {\n            if (Application.platform == RuntimePlatform.WindowsEditor)\n            {\n                OperatingSystem sys = System.Environment.OSVersion;\n                int major = sys.Version.Major;\n                int minor = sys.Version.Minor;\n                // Window 8 is technically version 6.2\n                if (orHigher)\n                    return major > 6 || (major == 6 && minor >= 2);\n                else\n                    return major == 6 && minor == 2;\n            }\n            return false;\n        }","sourceCodeStart":1141,"sourceCodeEnd":1177,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/InternalEditorUtility.bindings.cs#L1141-L1177","documentation":"Thrown by the default branch of a switch over the UnityEditorInternal.DllType enum that decides whether a DLL is a WinMD assembly. The switch only handles Unknown, Native, UnknownManaged, ManagedNET35, ManagedNET40, WinMDNative, WinMDNET40; any other enum value falls through to a generic Exception.","triggerScenarios":"A build or assembly-resolution path passes a DllType enum value added in a newer Unity version (or produced by a custom/unknown assembly type) that the switch was not updated to handle.","commonSituations":"Cross-version Unity builds where a new DllType was introduced. Custom precompiled assembly tooling that tags an assembly with an unexpected type. Corruption in assembly metadata producing an out-of-range enum value.","solutions":["Update the switch to explicitly handle the new DllType value with the correct managed/native classification.","Ensure the project and its packages target the same Unity version that defines the DllType values in use.","Inspect the offending assembly's reported DllType to determine whether its metadata/importer settings are correct."],"exampleFix":"// before\ncase UnityEditorInternal.DllType.WinMDNET40:\n    return true;\ndefault:\n    throw new Exception(...);\n\n// after\ncase UnityEditorInternal.DllType.WinMDNET40:\ncase UnityEditorInternal.DllType.NewType:\n    return true;","handlingStrategy":"validation","validationCode":"// Ensure the project and packages target one Unity version so DllType values match the switch.","typeGuard":null,"tryCatchPattern":"try { /* call site */ }\ncatch (Exception ex) when (ex.Message.StartsWith(\"Unknown dll type\")) { Debug.LogError($\"Unhandled DllType; check assembly metadata: {ex.Message}\"); }","preventionTips":["Keep Unity version consistent across project and packages","Extend the switch when new DllType values appear","Inspect reported assembly metadata on failure"],"tags":["unity","editor","dll","build","enum-switch"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}