Skip to content

Instantly share code, notes, and snippets.

View ElPavlillo's full-sized avatar

Pablo ElPavlillo

View GitHub Profile
using System.Diagnostics;
// !!! This is not working example !!!
namespace GracefulTermination
{
internal static class Program
{
private static async Task Main()
{
using var process = new Process
@RickStrahl
RickStrahl / CompilingCSharpCode.cs
Last active April 3, 2024 14:11
A few different approaches to dynamically execute C# code dynamically at runtime from a string of code.
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
using Mono.CSharp;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.Dynamic;
using System.Linq;