A .NET 8 demo that compiles and executes C# code at runtime with full debugging support.
- Runtime Compilation: Compiles C# functions from JSON definitions using Roslyn
- Debug Support: Enables breakpoints in dynamically compiled code via
Debugger.Break() - Version Management: Automatically recompiles when function versions change
- Hot Reload: Reload function definitions without restarting the app
- Functions are defined in
functions.jsonwith name, version, and source code (simulating a functions repository) - On execution, the app compiles the source to a DLL in the
generated/folder - The assembly is loaded and the
Runmethod is invoked - If the version changes, the function is recompiled automatically
Start the debugger in VSCode
Or run directly, but without the debugger attached.
dotnet build
dotnet runSelect a function from the list to execute it.