Build Cross-Platform Apps with C#, VB.NET, or F# and XAML
One codebase. Six platforms. Powered by WebAssembly and .NET.
Website · Documentation · Try Online · 200+ Live Samples · Gallery · What's New · Contact
- What is OpenSilver?
- Features
- How It Works
- Try OpenSilver Without Installing Anything
- Migrating from WPF, Silverlight, or LightSwitch?
- Create Your First OpenSilver App
- Code Sample
- Performance Tips
- Documentation and Resources
- Building from Source
- Contributing
- Related Repositories
- License
- Get in Touch
OpenSilver is a modern, open-source framework for building cross-platform applications using C#, VB.NET, or F# combined with XAML. Write your code once and deploy to:
- Web (via WebAssembly)
- Android, iOS, Windows, macOS (via .NET MAUI-OpenSilver Hybrid)
- Linux (via Photino)
OpenSilver is like WPF, but cross-platform and evolved. It brings the productivity of XAML and the power of .NET to every major platform.
- WPF API Compatibility (Subset): OpenSilver implements a large and growing subset of the WPF API. Same namespaces, same XAML, same patterns (MVVM, data binding, commands, styles, templates). If you know WPF, you already know OpenSilver.
- True Cross-Platform: Single codebase compiles to Web, Android, iOS, Windows, macOS, and Linux.
- DOM-Based Rendering: XAML renders to real HTML elements, unlocking native browser behaviors: accessibility, SEO, Ctrl+F, text selection, screen readers, browser translation, and more.
- Multi-Language Support: Write in C#, VB.NET, or F#. OpenSilver is one of the very few solutions that lets you build web apps with VB.NET + XAML or F# + XAML.
- Full .NET Ecosystem: Reference any .NET NuGet package. OpenSilver and Blazor WASM share the same .NET for WebAssembly stack, so any non-UI package that works in Blazor will work in OpenSilver too.
- Blazor Integration: Mix XAML and Razor files in the same project. Embed Blazor components (DevExpress, Syncfusion, Radzen, Blazorise, MudBlazor, etc.) directly inside XAML. Learn more
- JavaScript Interop: Call any JavaScript library from C#. Full access to the JS ecosystem from all target platforms. Learn more · Interop Samples · JS Libraries Samples
- Visual XAML Designer: Drag-and-drop UI designer in Visual Studio, VS Code (Windows, macOS, Linux), and online at XAML.io. The first XAML designer for VS Code!
OpenSilver is not an emulator, a wrapper, or an Electron-style bundled browser. It is a complete reimplementation of the WPF/Silverlight API from scratch, using modern .NET, WebAssembly, and the browser's DOM.
On the Web, your C# code compiles to WebAssembly. Unlike canvas-based rendering approaches, XAML is rendered at runtime using real HTML elements: TextBox becomes <textarea>, MediaElement becomes <video>, PasswordBox becomes <input type="password">, Image becomes <img>, and so on. This unlocks native browser behaviors like Ctrl+F search, text selection (to copy text), screen readers, SEO indexing, browser translation, mobile long-press, UI automated testing, and accessibility compliance. The compiled app is a set of static files (WebAssembly, JS, index.html...) that can be hosted anywhere: Azure, AWS, GitHub Pages, or any basic web server. No special server technology is required.
On desktop and mobile (via MAUI-OpenSilver Hybrid or Photino), the UI is still rendered as HTML/CSS, but C# runs as native .NET instead of WebAssembly. This preserves full compatibility with JS libraries and Blazor components (because the UI is still HTML/CSS), while adding native performance and direct access to platform APIs (because the runtime is native .NET).
XAML.io: Write and run C#/XAML code directly in your browser. No installation required. Perfect for quick experiments, learning, and sharing code snippets.
OpenSilverShowcase.com: Over 200 interactive C#/XAML samples running live. View source code for each sample with a toggle to switch between C#, VB.NET, and F#. Includes examples of Blazor component integration. Also available on Android and iOS. Source code.
Visit the Gallery to see real-world applications built with OpenSilver.
Because OpenSilver implements a subset of the WPF API, it provides a realistic path to bring existing applications to the web and mobile without a full rewrite:
- Silverlight apps: 99% API compatibility, minimal code changes needed
- WPF apps: 70%+ API compatibility and growing with every release
- LightSwitch apps: supported via a dedicated Compatibility Pack (Learn more · Request Compatibility Pack)
- WinForms apps: possible, though more refactoring is required
The team that built OpenSilver has been migrating enterprise applications since 2014. Whether you need a full end-to-end migration, help porting a specific module, or want to accelerate the implementation of a WPF feature your app depends on, we work with teams of all sizes.
We offer free migration assessments. Let's talk about your project
- Install Visual Studio 2022 or newer (VS 2026 is supported) with the
ASP.NET and web developmentand.NET desktop developmentworkloads, plus .NET 8.0 SDK or later - Download the OpenSilver extension (VSIX) from opensilver.net/download
- Click "Create a new project", search for "OpenSilver", and choose your target platforms
--
Preview packages: If you want the very latest iteration of OpenSilver, check "Include prerelease" in the NuGet Package Manager. Preview packages are built for each commit on the
developbranch and published to a MyGet feed (already configured in yournuget.config). Learn more
Install the OpenSilver extension for VS Code (includes project templates and the visual XAML designer), then use the Command Palette (Ctrl+Shift+P) and run OpenSilver: Create New Project. Learn more
dotnet new install OpenSilver.Templates
dotnet new opensilverapp -n MyApp
cd MyApp && dotnet run --project MyApp.BrowserVisit XAML.io, create your project in the browser, then click File > Download Visual Studio Solution to continue working locally in Visual Studio or VS Code.
| Project | Description |
|---|---|
| MyApp | Main project containing all your C#/XAML files. Cannot be run directly. |
| MyApp.Browser | Entry point for Web deployment (WebAssembly) |
| MyApp.MauiHybrid | Entry point for Android, iOS, Windows, macOS (via .NET MAUI) |
| MyApp.Photino | Entry point for Linux desktop (via Photino) |
| MyApp.Simulator | Entry point for the Simulator, which provides the best debugging experience (faster startup, better exception reporting, full .NET debugging features such as move execution point, etc.) |
<!-- MainPage.xaml -->
<Page x:Class="MyApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="Hello, OpenSilver!" FontSize="32" Margin="0,0,0,20"/>
<Button Content="Click Me!" Click="Button_Click"/>
<TextBlock x:Name="ResultText" FontSize="18" Margin="0,20,0,0"/>
</StackPanel>
</Page>// MainPage.xaml.cs
using System;
using System.Windows;
using System.Windows.Controls;
namespace MyApp;
public partial class MainPage : Page
{
private int clickCount = 0;
public MainPage()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
clickCount++;
ResultText.Text = $"Button clicked {clickCount} time(s)!";
}
}This example uses C#, but VB.NET and F# work equally well with XAML. See all three languages side by side on OpenSilverShowcase.com.
Debug mode is not representative of production performance. Here is a benchmark rendering 30,000 XAML UI elements (OpenSilver 3.2):
| Mode | Time | vs. Debug |
|---|---|---|
| Debug (from VS) | 2,150 ms | baseline |
| Release (from VS) | 1,630 ms | 1.3x faster |
| Published | 760 ms | 2.8x faster |
| Published + AOT | 360 ms | 6x faster |
For best results in production, publish with AOT enabled. Other common optimizations include enabling virtualization for large lists/comboboxes/treeviews, using IIS compression, lazy-loading large assemblies, and trimming to reduce the app size. Learn more
| Resource | Description |
|---|---|
| Official Documentation | Comprehensive guides, tutorials, and API reference |
| Getting Started Tutorial | Step-by-step walkthrough for beginners |
| Common Issues and Solutions | Troubleshooting tips |
| OpenSilverShowcase.com | 200+ live samples with source code |
Want to contribute or customize OpenSilver? See BUILDING.md for full instructions on cloning, building, and using custom NuGet packages.
The extensions for VS and VS Code can also built from source: github.com/OpenSilver/OpenSilver.VSIX
We welcome contributions from the community! Whether it's fixing bugs, improving documentation, or adding new features, every contribution helps make OpenSilver better.
- Read our Contributing Guide
- Check out the open issues
- Submit pull requests to the
developbranch
Missing a WPF feature? Request it on GitHub or sponsor its development to accelerate its implementation.
| Repository | Description |
|---|---|
| OpenSilver.VSIX | Source code for Visual Studio, VS Code, and CLI extensions |
| OpenSilver.Documentation | Documentation source |
| OpenSilver.Samples.Showcase | Source code for the Showcase app (200+ samples) |
OpenSilver is free and open source, released under the MIT License.
You can use OpenSilver in commercial projects without any licensing fees. While not required, attribution and links to opensilver.net are greatly appreciated!
| Website | opensilver.net |
| Documentation | doc.opensilver.net |
| Contact | opensilver.net/contact |
| contact@opensilver.net |
OpenSilver is built and maintained by Userware. It is free and MIT licensed. Working with Userware directly funds the roadmap toward full WPF API coverage and helps make OpenSilver better for everyone.
How we can help:
- Migrate your WPF, Silverlight, LightSwitch, or WinForms application
- Accelerate the implementation of a specific feature your project needs
- Support your team with priority assistance, training, or consulting
⭐ Star this repository if you find OpenSilver useful!
Your support helps us grow the community and improve the framework.








