Click here to Skip to main content
15,924,452 members
Articles / Programming Languages / C#

C# in Browser via WebAssembly (without Blazor)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (28 votes)
13 May 2024MIT14 min read 27.9K   59  
In this article I describe how to write C# code that runs in Browser.
This article explains how to run .NET C# code in Browser via WebAssembly. Several example are given - describing calling C# from JavaScript, calling JavaScript from C# and running C# Program.Main(...) method from the browser. Finally I provide an Avalonia sample showing ho to run Avalonia visuals built in C# in the browser.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Architect AWebPros
United States United States
I am a software architect and a developer with great passion for new engineering solutions and finding and applying design patterns.

I am passionate about learning new ways of building software and sharing my knowledge with others.

I worked with many various languages including C#, Java and C++.

I fell in love with WPF (and later Silverlight) at first sight. After Microsoft killed Silverlight, I was distraught until I found Avalonia - a great multiplatform package for building UI on Windows, Linux, Mac as well as within browsers (using WASM) and for mobile platforms.

I have my Ph.D. from RPI.

here is my linkedin profile

Comments and Discussions