Run a C# snippet in RunMacro
RunMacro RunnerRunMacro 3.5+
The Run C# Code command inserts and runs a C# snippet.
Dialog & quick setup

- Add a Code › Run C# Code command.
- Enter your C# snippet.
- Use
Console.WriteLine(...)to output to the log. Save.
Options reference
Modes & when to use
RunMacro Runner
Best for
- Leverage .NET libraries for a special task.
- Handle complex logic in C#.
- Integrate a C# computation/formatting snippet.
Use an alternative when
- Do not run unreviewed C# or when required compiler/runtime/references are unavailable.
Before you run
- Add Run C# Code to the macro.
- Prepare the data or target that Run C# Code will use.
Example workflow
Expected result: After execution, Run C# Code completes the described action and makes its result available to the next step.
Tips & limitations
You need dotnet-script, csi, or csc.exe available; otherwise the command reports it cannot run.
- Compilation can fail by version/reference; the assembly runs with process permissions and can modify the system.
Applies to RunMacro 3.5+ · RunMacro Runner · Windows 10/11
