Migrating from v2
TinyCLR v3 is mostly backwards-compatible at the library API level — the bulk of v2 application code compiles unchanged. The differences are in the project/solution tooling and in optional new features you can opt into when you're ready.
The short version
For most projects:
- Create a new TinyCLR Application in Visual Studio.
- Add your existing
.csfiles to the new solution. - Install the same NuGet packages you were using in v2 (search
tinyclrin the package manager). - Build, deploy, done.
The reason for starting fresh instead of opening the v2 solution is that the project and solution system has been updated in v3 — adding a new project type, refreshed NuGet references, and an updated deployment workflow. Old .csproj files often work after editing, but creating fresh from the template is faster and avoids subtle template/version mismatches.
What's new in v3
- Modern C# features —
async/await, top-level statements, generics (List<T>,Dictionary<TKey, TValue>,Stack<T>,Queue<T>) - Standard .NET IoT APIs for peripherals (GPIO, PWM, SPI, I²C, UART) alongside the original TinyCLR APIs — see Two APIs side-by-side below
- Dual mode — a TinyCLR project can run on the device and in Desktop mode (.NET Framework 4.8). See Desktop Mode.
- Visual Studio 2026 (any edition including Community) is the supported IDE for the v3 extension — and v3 also adds Visual Studio Code support via a dedicated extension. Both run on Windows only.
- Updated project/solution system with the changes above
The full list of changes between releases is in the release notes.
Two APIs side-by-side
For each of these peripherals, v3 adds the standard System.Device.* (.NET IoT) API as an alternative to the original GHIElectronics.TinyCLR.Devices.* API:
| Peripheral | Original TinyCLR API | New .NET IoT API |
|---|---|---|
| GPIO | GHIElectronics.TinyCLR.Devices.Gpio | System.Device.Gpio |
| PWM | GHIElectronics.TinyCLR.Devices.Pwm | System.Device.Pwm |
| SPI | GHIElectronics.TinyCLR.Devices.Spi | System.Device.Spi |
| I²C | GHIElectronics.TinyCLR.Devices.I2c | System.Device.I2c |
| UART | GHIElectronics.TinyCLR.Devices.Uart | System.IO.Ports.SerialPort |
Both APIs ship in the same NuGet package — install one and you have both. You can mix them freely in the same application.
Which one to use:
- Keep using the original API if you're porting v2 code as-is. Nothing to change.
- Adopt the new .NET IoT API for new code, or when you want portability with desktop .NET IoT applications.
The feature pages cover both APIs side-by-side in tabbed examples — see GPIO, PWM, SPI, I²C, and UART.
Step-by-step: bringing a v2 project to v3
- Install TinyCLR v3 — Visual Studio extension and matching firmware. See Getting Started for the current installer links.
- Update the firmware on your device to a matching v3 version using TinyCLR Config.
- Create a new TinyCLR Application in Visual Studio (
File → New → Project → C# → TinyCLR). - Copy your
.cssource files from the v2 project into the new project's folder, then add them to the project viaProject → Add → Existing Item…. Don't copy.csprojor solution files — let the new template own those. - Reinstall the NuGet packages your code uses (
GHIElectronics.TinyCLR.Devices.Gpio,.Pins, networking packages, drivers, etc.). The package names didn't change; just install the v3 versions. - Build and deploy. Most code will compile and run; fix any compilation warnings about deprecated members as they appear.
When code doesn't compile
If a v2 method or property doesn't exist in v3, the typical resolution is one of:
- A namespace moved — adjust the
usingdirective - A method was renamed for consistency with .NET conventions — the new name is usually obvious from IntelliSense
- A method was replaced by the equivalent standard .NET IoT API — see Two APIs side-by-side
The release notes call out the changes for each release.
What didn't change
- The NuGet package names — same as v2 (
GHIElectronics.TinyCLR.X) - The original
GHIElectronics.TinyCLR.Devices.*APIs — your v2 GPIO/PWM/SPI/I²C/UART code keeps working - The deployment workflow — same
F5to deploy and debug - The bootloader protocol — devices flashed in v2 can be updated to v3 firmware via TinyCLR Config
Most upgrades take less time than reading this page.