CSharp Snippet Runner

approved

by OHM Engineering

Run C# code blocks in Obsidian using an auto-installed CSharpRepl runtime. - This plugin has not been manually reviewed by Obsidian staff.

149 downloadsUpdated 2mo ago0BSD

CSharp Snippet Runner

Obsidian plugin that adds a run button to C# code blocks. It uses CSharpRepl to execute the snippets and displays the output directly in the note.

Schermafbeelding 2026-05-29 110157

Features

  • Supports code blocks containing C# code with tags csharp, cs, c#, net, .net and dotnet
  • Adds a Run button below each block with one of the above tags
  • Runs snippets using bundled CSharpRepl auto-installed with dotnet tool into the plugin folder
  • Supports optional script arguments
  • Saves output and arguments per snippet in the plugin responses folder
  • Restores saved output/arguments when notes are rendered

Requirements

  • Obsidian version >= 1.12.7
  • dotnet SDK installed on your PC

Usage

  • Add a code snippet to your Obsidian note with one of these tags: csharp, cs, c#, net, .net or dotnet
  • Optionally enter args
  • Click Run C#

See CSharpRepl on how to use with includes and nuget packages

Development

npm install
npm run dev

Build

npm run build

Manual installation

Copy these files to:

<Vault>/.obsidian/plugins/csharp-snippet-runner/

  • main.js
  • manifest.json
  • styles.css

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.