Development on Linux of .NET Applications
Rainer Stropek | time cockpit
Linux for .NET Dev
Options
Linux on your PC or in a VM (on-premises or cloud)
π
Supported distros/OS versions for .NET
π
Installation types
π
Β (manual, Snap, scripted)
β οΈ Before switching, verify that all required apps are available
Containerized environment (Docker)
Independent of host OS (with Docker Desktop)
No installation/update required
.NET on docker hub
π
Cloud development environments
E.g. GitHub Codespaces, gitpod
Windows Subsystem for Linux (WSL 2)
π
Linux environment on Windows without VM or dual-boot
My personal favorite
WSL 2
Windows and Linux kernels run side-by-side
Linux kernel nicely integrated with Windows
(e.g. file system access, running apps with/without GUI)
systemd
Β support
π
USB support via USBIPD
π
Option: Get Linux distros from Windows Store
You can also import/create other distros
Use WSL as backend for Docker Desktop
π
Better performance than VM
Enterprise-readiness
π
Tip: Combine with Windows Terminal
π
WSL Demos
IDE Options
IDE Options on/for Linux
IDE on Linux
VSCode and VSCode Forks (e.g. Cursor AI)
JetBrains Rider
π
Any other editor with support for .NET LSP (e.g. Neovim)
Visual Studio on Windows + Debug in container
Docker support in Visual Studio
Not my personal favorite
Remote Development with VSCode and forks
π
SSH, containers, WSL, GitHub Codespaces
My personal favorite
Remote Development Demos
.NET on Linux
.NET on Linux
Linux support in .NET since .NET Core
Good Linux support in recent .NET versions
Target frameworks for .NET
π
TFM = Target Framework Moniker
Portable vs. OS-specific
Use multiple TFMs if applicable
π
.NET Runtime Identifier
π
Identify target platform (e.g.
linux-x64
)
E.g. used when building platform-specific executables
Publishing Demos
Tips for Cross-Platform Development
Tips
Avoid exploiting platform-specific behaviors. Examples:
Case-insensitive file names on Windows
Write platform-independent code. Examples:
Use
Path
Β to combine folder names
Use
Environment.NewLine
Use UTF-8 encoding for text files
Use Environment.GetFolderPath to get special folders
Avoid platform-specific features. Examples:
Configuration files or environment variables instead of Windows Registry
gRPC
over Sockets instead of Windows Named Pipes
Open Telemetry
Β instead of Windows Event Log
Tips
Be aware of platform specifics. Examples:
Higher path length limit on Linux
File permissions work differently on Windows and Linux
Symbolic links on Linux
Consider platform-specific implementations via DI
Avoid platform-specific UI technologies
Avalonia or MAUI for desktop apps
Web UI
Use cross-platform script platform for automation tasks
TypeScript instead of bash
PowerShell on Linux
Tips (Skills)
Get foundational knowledge about Linux
Basic commands, package management, Linux monitoring tools, networking fundamentals, etc.
Become familiar with dotnet-related CLIs
Frequently used when developing on Linux
Containers are important on Linux
Get familiar with Docker or similar technology
Q&A
Rainer Stropek | time cockpit