C# and Razor compiler playground in the browser via Blazor WebAssembly
See the code(aka Razor Lab, formerly also DotNetInternals)
C# and Razor compiler playground.
In the browser via Blazor WebAssembly. https://lab.razor.fyi/
Native app (full .NET, best performance) on Windows Store
and Android Play Store.
#:property directives (both with editor completions).#:package directives.For prerequisites, see eng/build.sh (in short: you need .NET SDK according to global.json
and workloads wasm-tools wasm-experimental).
The recommended startup app for development is src/Server.
To hit breakpoints, it is recommended to turn off the worker (in app settings).
eng/BuildTools: build-time tools.src/App: the core app.src/Compiler: self-contained project referencing Roslyn/Razor.
It's reloaded at runtime with a user-chosen version of Roslyn/Razor.
It should be small (for best reloading perf). It can reference shared code
which does not depend on Roslyn/Razor from elsewhere (e.g., Shared.csproj).src/RazorAccess: internal access to Razor DLLs (via fake assembly name).src/RoslynAccess: internal access to Roslyn Compiler DLLs (via fake assembly name).src/RoslynCodeStyleAccess: internal access to Roslyn CodeStyle DLLs (via fake assembly name).src/RoslynWorkspaceAccess: internal access to Roslyn Workspace DLLs (via fake assembly name).src/Server: a Blazor Server entrypoint for easier development of the App
(it has better tooling support for hot reload and debugging).src/Shared: code used by Compiler that does not depend on Roslyn/Razor.src/WebAssembly: web-assembly host of the App (this is what's deployed online).
dotnet tool restore
dotnet workload restore
dotnet publish ./src/WebAssembly/ && dotnet serve -d ./artifacts/publish/WebAssembly/release/wwwroot/ -o -q
src/Worker: a separate component that can be loaded in a web worker (a separate process in the browser),
so it does all the CPU-intensive work to avoid lagging the user interface.src/WorkerApi: shared code between Worker and App.
This is in preparation for making the worker independent of the app,
so the app can be optimized (trimming, NativeAOT) and the worker can be loaded more lazily.src/WorkerWebAssembly: web-assembly host of the Worker.test/UnitTestsRazor REPLs:
C# REPLs:
C# compiler playgrounds:
XAML REPLs:
Web IDEs:
606 followers · starred Sep 2025
116 followers · starred Oct 2025
168 followers · starred Jun 2025
708 followers · starred Oct 2025
C# and Razor compiler playground in the browser via Blazor WebAssembly
See the code(aka Razor Lab, formerly also DotNetInternals)
C# and Razor compiler playground.
In the browser via Blazor WebAssembly. https://lab.razor.fyi/
Native app (full .NET, best performance) on Windows Store
and Android Play Store.
#:property directives (both with editor completions).#:package directives.For prerequisites, see eng/build.sh (in short: you need .NET SDK according to global.json
and workloads wasm-tools wasm-experimental).
The recommended startup app for development is src/Server.
To hit breakpoints, it is recommended to turn off the worker (in app settings).
eng/BuildTools: build-time tools.src/App: the core app.src/Compiler: self-contained project referencing Roslyn/Razor.
It's reloaded at runtime with a user-chosen version of Roslyn/Razor.
It should be small (for best reloading perf). It can reference shared code
which does not depend on Roslyn/Razor from elsewhere (e.g., Shared.csproj).src/RazorAccess: internal access to Razor DLLs (via fake assembly name).src/RoslynAccess: internal access to Roslyn Compiler DLLs (via fake assembly name).src/RoslynCodeStyleAccess: internal access to Roslyn CodeStyle DLLs (via fake assembly name).src/RoslynWorkspaceAccess: internal access to Roslyn Workspace DLLs (via fake assembly name).src/Server: a Blazor Server entrypoint for easier development of the App
(it has better tooling support for hot reload and debugging).src/Shared: code used by Compiler that does not depend on Roslyn/Razor.src/WebAssembly: web-assembly host of the App (this is what's deployed online).
dotnet tool restore
dotnet workload restore
dotnet publish ./src/WebAssembly/ && dotnet serve -d ./artifacts/publish/WebAssembly/release/wwwroot/ -o -q
src/Worker: a separate component that can be loaded in a web worker (a separate process in the browser),
so it does all the CPU-intensive work to avoid lagging the user interface.src/WorkerApi: shared code between Worker and App.
This is in preparation for making the worker independent of the app,
so the app can be optimized (trimming, NativeAOT) and the worker can be loaded more lazily.src/WorkerWebAssembly: web-assembly host of the Worker.test/UnitTestsRazor REPLs:
C# REPLs:
C# compiler playgrounds:
XAML REPLs:
Web IDEs:
606 followers · starred Sep 2025
116 followers · starred Oct 2025
168 followers · starred Jun 2025
708 followers · starred Oct 2025