Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compile and execute C# code from string at run time
#5
thank you!
Using the nuget package from the video and the code below, it can be executed successfully.
 
Code:
Copy      Help
void Main()
{
    print.clear();

    string code = """
using System;
using Au;

foreach (var v in args) Console.WriteLine(v);
""";

    var c = CsScript.Compile(code, r: [@"C:\Program Files\LibreAutomate\Au.dll"]);
    if (c == null) return;

    c.Run("command", "line", "arguments");
}


Messages In This Thread
RE: Compile and execute C# code from string at run time - by Davider - 07-31-2025, 03:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)