{"record":{"id":"f871926e3fa41d9d","repo":"Unity-Technologies/UnityCsReference","slug":"coreclr-is-not-supported-for-this-platform","errorCode":null,"errorMessage":"CoreCLR is not supported for this platform.","messagePattern":"CoreCLR is not supported for this platform\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/IScriptingPlatformProperties.cs","lineNumber":14,"sourceCode":"// Unity C# reference source\n// Copyright (c) Unity Technologies. For terms of use, see\n// https://unity3d.com/legal/licenses/Unity_Reference_Only_License\n\nusing System;\n\nnamespace UnityEditor;\n\ninternal interface IScriptingPlatformProperties : IPlatformProperties\n{\n    /// <summary>\n    /// Points to the CoreCLR BCL Directory\n    /// </summary>\n    public string CoreCLRBCLDirectory => throw new NotSupportedException(\"CoreCLR is not supported for this platform.\");\n\n    /// <summary>\n    /// Points to the IL2CPP directory\n    /// </summary>\n    public string IL2CPPBCLDirectory => throw new NotSupportedException(\"IL2CPP is not supported for this platform.\");\n\n}\n","sourceCodeStart":1,"sourceCodeEnd":22,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/IScriptingPlatformProperties.cs#L1-L22","documentation":"IScriptingPlatformProperties.CoreCLRBCLDirectory throws NotSupportedException, indicating that this scripting platform does not support CoreCLR as a backend. The property is a default interface member so all implementations inherit the throw unless they override it with a real directory path.","triggerScenarios":"Accessing CoreCLRBCLDirectory on a platform implementation that does not override it (i.e., a platform without CoreCLR support, such as older Mono-only targets).","commonSituations":"Build pipeline or platform configuration code that probes a platform's BCL directory without first checking whether CoreCLR is available; common during player build setup for non-standard or legacy platforms.","solutions":["Check whether the platform supports CoreCLR before accessing CoreCLRBCLDirectory.","Fall back to IL2CPPBCLDirectory for platforms that do not support CoreCLR.","Catch NotSupportedException and use the IL2CPP path as an alternative."],"exampleFix":"// before\nstring bcl = props.CoreCLRBCLDirectory;\n// after\nstring bcl;\ntry { bcl = props.CoreCLRBCLDirectory; }\ncatch (NotSupportedException) { bcl = props.IL2CPPBCLDirectory; }","handlingStrategy":"fallback","validationCode":"string bcl;\ntry {\n    bcl = props.CoreCLRBCLDirectory;\n} catch (NotSupportedException) {\n    bcl = props.IL2CPPBCLDirectory;\n}","typeGuard":null,"tryCatchPattern":"try {\n    bclDir = props.CoreCLRBCLDirectory;\n} catch (NotSupportedException) {\n    bclDir = props.IL2CPPBCLDirectory;\n}","preventionTips":["Check platform scripting-backend capabilities before probing BCL directory properties.","Treat NotSupportedException on default interface members as a signal that the feature is unsupported on that platform."],"tags":["scripting-backend","coreclr","platform","not-supported","unity-editor"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}