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]. - Each assembly is limited to 64 KB. For larger codebases, split your solution into multiple assemblies — better maintainability too. Resource files are not subject to this limit, so large lookup tables and binary objects should be included as resources.
- 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. - 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