Develop TinyCLR OS applications in Visual Studio Code: create projects, edit C#, build managed assemblies, deploy, and debug—with the same TinyCLR devices from GHI Electronics, adapted for the VS Code workflow.
Platform: device programming (deploy, debug, USB, Serial) is supported on Windows.
Requirements (for using the extension)
- Windows for deploy, debug, and on-device workflows.
- Visual Studio Code.
- .NET SDK or Visual Studio Build Tools on the machine, so TinyCLR: Build can compile your .csproj (TinyCLR apps target .NET Framework 4.8 in the usual project layout).
- A C# language extension (for example Microsoft’s C# extension,
ms-dotnettools.csharp) for a smooth editing experience in .cs / .csproj files. - TinyCLR board with appropriate USB driver / cable; for serial debugging, a COM port at 115200 baud as configured in your launch JSON.
Install the extension from the .vsix your team or release provides: Extensions → ⋯ → Install from VSIX….
What you can do
| Area | What the extension offers |
|---|---|
| Create | TinyCLR: New Project — scaffolds a TinyCLR application (project file, packages.config layout, .vscode tasks and launch configs). Restores every package listed in packages.config into packages/ (NuGet user cache or nuget.org). |
| Add code | TinyCLR: New Class — adds a C# class file consistent with the Visual Studio TinyCLR class item template and updates the .csproj. |
| Build | TinyCLR: Build — restores every package in packages.config into packages/ (NuGet user cache or nuget.org), then runs MSBuild (dotnet build), then the bundled TinyCLR DebugServer pipeline to emit .pe files for flashing. |
| Device | TinyCLR: Select Device — pick your board from the list; status bar shows the current target. |
| Deploy | TinyCLR: Deploy to Device — uploads .pe files to the device. |
| Debug | Run and Debug (F5) — Deploy and Debug configurations deploy, attach the debugger, breakpoints, Locals, Call Stack, and the built-in Watch view (simple identifiers, same idea as hovers). |
| USB | Full USB transport for deploy and debug (WinUSB / MFDeploy-style enumeration). |
| Serial | Serial @ 115200 transport for deploy and debug when you use the matching launch configuration—useful when USB is not available or you prefer UART. |
Logs for build and device steps appear under View → Output → channel TinyCLR.
When you debug (F5) or use an installed .vsix, the TinyCLR debug server writes progress and errors to stderr; the extension shows those lines in the same TinyCLR output channel with the prefix [DAP server] (for example deploy steps and connection messages). The server uses an auto-flushing stderr writer so those lines appear live when stderr is a pipe (as with the packaged extension), not only after the buffer fills. The server also maintains a rolling log file at %TEMP%\TinyCLR.DebugServer.log (on a typical Windows install this resolves to something like C:\Users\<you>\AppData\Local\Temp\TinyCLR.DebugServer.log), which is handy to attach when asking for support.
Typical workflow
- Open the folder that contains your TinyCLR .csproj (or use TinyCLR: New Project and open the new folder).
- TinyCLR: Select Device and choose your hardware (USB or you will pick the serial device when using a serial launch config).
- TinyCLR: Build (or let F5 build for you).
- Run and Debug — choose Deploy and Debug (TinyCLR, USB) or Deploy and Debug (TinyCLR, Serial 115200) and press F5.
More information
- Product and docs: GHI Electronics
- Community: GHI community forum