This guide explains how to build the OpenSilver framework from source, whether you want to contribute or create a custom build for your own project.
- Visual Studio 2022 or newer (latest version recommended)
- Developer Command Prompt for VS 2022 (or newer)
-
Clone the Repository
git clone https://github.com/OpenSilver/OpenSilver.git cd OpenSilver -
Restore Packages
Run the restoration script at the root of the repository:
restore-packages-opensilver.bat
-
Update Compiler Assemblies
OpenSilver has a dependency on an older version of itself to convert XAML files to C#. The restored version may sometimes have outdated compiler assemblies. To ensure you have the latest, run:
cd build update-compiler.bat -
Build the NuGet Package
Open the Developer Command Prompt for VS 2022 (not the standard Command Prompt) and navigate to the
buildfolder:cd build build-nuget-package-OpenSilver.batWhen prompted, enter a version identifier (e.g.,
2026-01-30). -
Use Your Custom Build
The built NuGet packages will be in
build/output/OpenSilver/. To use them in your projects:- Add a local NuGet source pointing to that folder
- In the NuGet Package Manager, check "Include prerelease" to see your custom packages
-
Use TestApplication: The main solution (
OpenSilver.sln) includes aTestApplication.OpenSilver.Browserproject that directly references the OpenSilver runtime instead of referencing the NuGet package. This is ideal for rapid development: changes to the OpenSilver runtime immediately affect the TestApplication without rebuilding packages or copying DLLs. -
Build only the Runtime DLL: Instead of rebuilding the entire package for every change, you can build just the OpenSilver Runtime project.
-
Auto-copy with Post Build: Add a Post Build action to the OpenSilver Runtime project to automatically copy the DLL to your NuGet cache:
C:\Users\YOUR_USER_NAME\.nuget\packages\opensilver\VERSION\lib\netstandard2.0\ -
Other packages: There are also separate batch files for building the Simulator, WebAssembly, MAUI Hybrid, and other packages as needed.
| Folder | Description |
|---|---|
src/Runtime |
Core OpenSilver runtime (the C#/XAML framework) |
src/Compiler |
XAML to C# compiler |
src/Simulator |
Windows Simulator for debugging |
src/WebAssembly |
WebAssembly integration |
src/Maui |
.NET MAUI Hybrid integration |
src/Photino |
Photino integration for Linux |
src/Tests |
Unit tests and TestApplication |
build |
Build scripts, NuGet specifications, and output folder |
| Branch | Description |
|---|---|
develop |
Active development. Submit pull requests here. |
master |
Stable releases. Corresponds to packages on NuGet.org. |
- Compilation errors: A Visual Studio workload may need to be installed. Open
OpenSilver.slnin Visual Studio to check for missing components. - Command Prompt issues: Make sure you use the "Developer Command Prompt for VS 2022" (not the standard Command Prompt). Some paths in the batch files are relative to the current directory.
- Still having issues? Open an Issue on GitHub or contact the OpenSilver team.