Skip to content

nbarkhina/CSharp-In-Browser

Repository files navigation

Notes

This is a fully web based C# Compiler. Simply edit the code and just make sure the Run() function returns a string. Then click the "Compile and Run" button to see the result. It uses the Mono Webassembly Runtime. You can also load from several included code examples. I added most of the popular .NET System DLL's and a few others like Newtonsoft. You can view a demo of it running here -


https://neilb.net/monogithub/


The first time you go to the page it may take a long time to load because it has to download all the DLLs

Build Instructions

  • Unzip Mono Wasm SDK
  • Install Mono on Windows
  • Update path to WebAssembly.Bindings.dll in WasmRoslyn.csproj based on where you unzipped the Mono Wasm SDK
  • Update paths in the build.ps1 file
  • Open terminal in VS Code
  • For a new machine you will need to unblock the powershell script
    • Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
  • Install the VS Code C# Extension
  • now open the folder in VS Code
    • the C# extension will then tell you to restore any dependencies
    • say yes
    • this should now create a bin and obj folder
  • run .\build.ps1 twice (first time it may give an error)
  • publish the code to a web server
  • Serve app from http://[YOUR SERVER]/publish/index.html

About

Fully web based C# Compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published