.NET runs on Windows, macOS, Linux, iOS, Android, and the web. One codebase. Multiple platforms. Here's why that matters.
// Same code runs everywhere
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello from any platform!");
app.Run();
Build on your Mac. Deploy to Linux. Develop on Windows. Target mobile. One language. One framework.
Wasn't .NET Windows-Only?
That was .NET Framework. Dead since 2019.
Modern .NET (formerly ".NET Core") is fully cross-platform since version 1.0 in 2016. Microsoft rewrote the runtime for portability. Today:
- .NET 10 runs natively on Windows, macOS, and Linux
- Apple Silicon (M1/M2/M3/M4) has first-class support
- ARM processors are fully supported
- Containers work on any Linux distribution
The old Windows-only days are over.
What Platforms Can I Target?
Server/Desktop
| Platform | Support Level |
|---|---|
| Windows x64 | Full support |
| Windows ARM64 | Full support |
| macOS x64 (Intel) | Full support |
| macOS ARM64 (Apple Silicon) | Full support |
| Linux x64 | Full support |
| Linux ARM64 | Full support |
| Alpine Linux | Full support |
Mobile
| Platform | Technology |
|---|---|
| iOS | .NET MAUI |
| Android | .NET MAUI |
| iPadOS | .NET MAUI |
Web
| Target | Technology |
|---|---|
| Server-side web | ASP.NET Core |
| Client-side web | Blazor WebAssembly |
Desktop
| Platform | Options |
|---|---|
| Windows | WPF, WinForms, MAUI, Avalonia |
| macOS | MAUI, Avalonia |
| Linux | Avalonia |
How Does Cross-Platform Work?
.NET compiles to Intermediate Language (IL). At runtime, the Just-In-Time (JIT) compiler translates IL to native machine code for the current platform.
C# Code → IL (platform-independent) → Native Code (platform-specific)
You write once. The runtime handles platform differences.
Can I Cross-Compile?
Yes. Build for any platform from any platform:
# Build Windows executable on macOS
dotnet publish -r win-x64 --self-contained
# Build Linux binary on Windows
dotnet publish -r linux-x64 --self-contained
# Build macOS app on Linux
dotnet publish -r osx-arm64 --self-contained
Self-contained deployment bundles the .NET runtime. Your app runs on target machines without .NET installed.
What About Performance?
.NET performance is excellent on all platforms. The JIT compiler optimizes for each CPU architecture.
TechEmpower benchmarks consistently show ASP.NET Core among the fastest web frameworks. The same performance advantage applies to:
- Linux servers (most production deployments)
- macOS development machines
- Windows desktop applications
No platform penalty.
What Is .NET MAUI?
Multi-platform App UI. Build mobile and desktop apps from one codebase:
// Shared UI code
public class MainPage : ContentPage
{
public MainPage()
{
Content = new StackLayout
{
Children =
{
new Label { Text = "Hello, World!" },
new Button { Text = "Click Me" }
}
};
}
}
This runs on:
- iOS
- Android
- macOS
- Windows
One project. Four platforms.
What Is Blazor?
Web UI framework using C# instead of JavaScript:
Blazor Server: UI runs on server, updates via SignalR
Blazor WebAssembly: UI runs in browser via WebAssembly
@page "/counter"
<h1>Counter: @count</h1>
<button @onclick="Increment">Click me</button>
@code {
private int count = 0;
private void Increment() => count++;
}
C# developers building web apps without learning JavaScript frameworks.
What Is Avalonia?
Open-source cross-platform UI framework. Unlike MAUI, it supports Linux desktop:
// Runs on Windows, macOS, AND Linux
public class MainWindow : Window
{
public MainWindow()
{
Content = new TextBlock { Text = "Hello, Linux!" };
}
}
True desktop application support on all three major operating systems.
What About Containers?
.NET is container-native:
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /app
COPY . .
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app/out .
ENTRYPOINT ["dotnet", "MyApp.dll"]
Microsoft provides official images:
- sdk — Building apps
- aspnet — Running web apps
- runtime — Running console apps
Alpine variants for minimal image size (~100MB for web apps).
How Do Teams Benefit?
Mixed Development Environments
Developer A: Windows + Visual Studio
Developer B: macOS + Rider
Developer C: Linux + VS Code
Same codebase. Same build. Different machines.
CI/CD Flexibility
Build on any platform:
- GitHub Actions (Ubuntu runners are cheapest)
- Azure DevOps (Linux, Windows, macOS)
- Jenkins (any platform)
Deployment Options
- Linux containers (most cost-effective)
- Windows Server (enterprise environments)
- Azure App Service (managed PaaS)
- AWS Lambda (serverless)
- Any cloud, any platform
What Are the Alternatives?
| Framework | Pros | Cons |
|---|---|---|
| Java | Mature ecosystem | Verbose, slower evolution |
| Python | Easy to learn | Slower runtime, GIL |
| Go | Simple, fast | Less mature ecosystem |
| Node.js | JavaScript everywhere | Single-threaded, callback complexity |
| Rust | Memory safe, fast | Steep learning curve |
.NET offers:
- Modern language features (C# evolves yearly)
- Strong performance
- Excellent tooling
- Large ecosystem
- Enterprise support
What About Vendor Lock-In?
.NET is open source. The runtime, libraries, and SDK are all on GitHub under MIT license.
You can:
- Fork the code
- Build from source
- Run anywhere
Microsoft maintains it, but you're not locked in.
When Should I NOT Use .NET Cross-Platform?
iOS/Android games: Unity (uses C# but separate runtime)
Low-level systems programming: Rust or C++
Quick scripts: Python might be faster to write
Maximum ecosystem size: JavaScript/Node.js for web
For most business applications, .NET cross-platform is an excellent choice.
Quick Setup for Cross-Platform
# Install .NET SDK
# Windows: winget install Microsoft.DotNet.SDK.10
# macOS: brew install dotnet-sdk
# Linux: sudo apt install dotnet-sdk-10.0
# Create cross-platform web app
dotnet new webapi -n MyApi
cd MyApi
dotnet run
# Build for different platforms
dotnet publish -r linux-x64 --self-contained
dotnet publish -r osx-arm64 --self-contained
dotnet publish -r win-x64 --self-contained
Summary
| Question | Answer |
|---|---|
| Does .NET run on Mac? | Yes, natively |
| Does .NET run on Linux? | Yes, natively |
| Can I build mobile apps? | Yes, with MAUI |
| Can I build web apps? | Yes, with ASP.NET Core and Blazor |
| Is it open source? | Yes, MIT license |
| Is there vendor lock-in? | No |
| Is performance good? | Among the fastest |
.NET in 2025 is a true cross-platform framework. Windows-only is history.
Written by Jacob Mellor, CTO at Iron Software. Jacob created IronPDF and leads a team of 50+ engineers building .NET document processing libraries.
Top comments (0)