Limitations
TinyCLR is built for small, secure, embedded products. To keep performance high and application memory maximized on resource-constrained devices, a few features from full .NET are limited or unavailable. Here are the limitations you're most likely to run into, along with workarounds.
- Multidimensional arrays are not supported. Use jagged arrays instead —
[1][1]rather than[1,1]. - Compiled code is capped at 64 KB per assembly. That's the IL only — bigger than it sounds, and a lot of embedded logic. Resources live in a separate stream and don't count toward it, so images, fonts, lookup tables, and binary blobs can be far larger. The other metadata streams (strings, signatures, type and method tables) share the same 64 KB ceiling, so a very large number of types or string literals in one assembly can hit the limit before the IL does.
- A maximum of 64 assemblies can be loaded at once.
await Task<T>(awaiting a generic task) is not supported. Start the task and read.Resultinstead. Awaiting a non-genericTask(for exampleawait Task.Delay(...)orawait Task.WhenAll(Task[])) works.- Some advanced generic scenarios are not supported. The generic collections and interfaces provided work, but a generic type boxed across an
async/awaitsuspension does not — this is the root of theTask<T>await limitation above. boolandcharlose their exact type when stored in an unconstrained generic. They widen to a 32-bit integer, soToString()returns the numeric form. Only the rendering is affected — comparisons and arithmetic are still correct. Convert to a string before storing, or use a concrete type. Other value types are unaffected.default(T)for a value-typeTdoes not compare equal to the literal. Don't use it as a "not found" sentinel; return an explicit found/not-found flag instead.- LINQ is LINQ-to-Objects only.
Join/GroupJoin, the set operators (Union/Intersect/Except),Zip, andDefaultIfEmptyare not included, and there is noIQueryable/PLINQ. TupleandValueTuplesupport 1–7 elements. Tuple literals and deconstruction are included; the 8-or-more element nested ("TRest") form is not.List<T>provides only common operations. The indexer andAdd/Insert/Remove/Sort/Find/BinarySearch(etc.) are supported; less-common members such asAsReadOnlyandSliceare not included.Dictionary<TKey, TValue>provides only common operations. The indexer andAdd/Remove/TryGetValue/Keys/Valuesare supported; enumeration order is not guaranteed and serialization is not included.- C# 12 is supported, with these limitations:
- Inline arrays are not supported. The
[InlineArray]struct attribute is not available. - Collection expressions can't target
Span<T>or custom collection builders.[1, 2, 3]works for arrays andList<T>, but not forSpan<T>/ReadOnlySpan<T>or types that use[CollectionBuilder]. - UTF-8 string literals (
"…"u8) are not supported. They produce aReadOnlySpan<byte>, which TinyCLR does not include.
- Inline arrays are not supported. The