Unity-Technologies/UnityCsReference · error · NotSupportedException
CoreCLR is not supported for this platform.
Error message
CoreCLR is not supported for this platform.
What it means
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.
Source
Thrown at Editor/Mono/IScriptingPlatformProperties.cs:14
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
namespace UnityEditor;
internal interface IScriptingPlatformProperties : IPlatformProperties
{
/// <summary>
/// Points to the CoreCLR BCL Directory
/// </summary>
public string CoreCLRBCLDirectory => throw new NotSupportedException("CoreCLR is not supported for this platform.");
/// <summary>
/// Points to the IL2CPP directory
/// </summary>
public string IL2CPPBCLDirectory => throw new NotSupportedException("IL2CPP is not supported for this platform.");
}
View on GitHub (pinned to 225b0fbdb5)
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.
Example fix
// before
string bcl = props.CoreCLRBCLDirectory;
// after
string bcl;
try { bcl = props.CoreCLRBCLDirectory; }
catch (NotSupportedException) { bcl = props.IL2CPPBCLDirectory; } Defensive patterns
Strategy: fallback
Validate before calling
string bcl;
try {
bcl = props.CoreCLRBCLDirectory;
} catch (NotSupportedException) {
bcl = props.IL2CPPBCLDirectory;
} Try / catch
try {
bclDir = props.CoreCLRBCLDirectory;
} catch (NotSupportedException) {
bclDir = props.IL2CPPBCLDirectory;
} Prevention
- 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.
When it happens
Trigger: Accessing CoreCLRBCLDirectory on a platform implementation that does not override it (i.e., a platform without CoreCLR support, such as older Mono-only targets).
Common situations: 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.
Related errors
- IL2CPP is not supported for this platform.
- For the '{0}' target the 'locationPathName' parameter for Bu
- Unhandled scripting backend {scriptingBackend}
- Cannot create build profile for '{platformName}' (GUID: {pla
- Platform GUID {platformGuid} is not a valid Unity build plat
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/f871926e3fa41d9d.
Report an issue: GitHub.