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

  1. Check whether the platform supports CoreCLR before accessing CoreCLRBCLDirectory.
  2. Fall back to IL2CPPBCLDirectory for platforms that do not support CoreCLR.
  3. 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

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


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/f871926e3fa41d9d. Report an issue: GitHub.