explaingit

akeit0/csharp-markup-extension

Analysis updated 2026-05-18

14C#Audience · developerComplexity · 3/5Setup · moderate

TLDR

A proof-of-concept that brings JSX-like tag syntax from React into C#, letting developers write HTML-like markup that a build-time tool turns into normal C# code.

Mindmap

mindmap
  root((repo))
    What it does
      Adds JSX tags to C#
      Translates tags via Roslyn generator
      Runs during normal build
    Tech stack
      Csharp
      dotnet
      Roslyn source generator
      VS Code extension
    Use cases
      Write component style UI in C#
      Try factory direct or fluent modes
      Explore sample apps
    Audience
      Csharp developers
      Dotnet and Unity and Blazor users
    Status
      Proof of concept
      VS Code only
      Fragments not supported

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Write component-style UI markup directly inside C# code using JSX-like tags.

USE CASE 2

Explore the sample apps to see factory, direct-call, and fluent translation modes.

USE CASE 3

Get syntax highlighting and completion for .csmx files in Visual Studio Code.

USE CASE 4

Learn how a Roslyn source generator can extend C# with a custom file type.

What is it built with?

C#.NETRoslynVS Code

How does it compare?

akeit0/csharp-markup-extensioncws6206/easynetworkscannerdavidichalfyorov-wq/project-sirius
Stars141414
LanguageC#C#C#
Setup difficultymoderateeasymoderate
Complexity3/52/54/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires .NET and Node.js to build both the compiler and the VS Code extension, plus a git submodule checkout.

The explanation does not state the project's license.

In plain English

JSX is a syntax feature from the React JavaScript ecosystem that lets developers write HTML-like markup directly inside their code. Instead of building a button with function calls, you write a tag like <button>Click</button> and a build tool transforms it into the actual function calls. CSMX is a proof-of-concept that brings that same idea to C#, the programming language commonly used with Microsoft tools like .NET, Unity, and Blazor. The project introduces a new file type.csmx, which is ordinary C# code that also allows JSX-like tag expressions wherever a normal C# expression would fit. A tag like <stack><text>Hello</text></stack> gets translated into a chain of function calls in plain C# before the regular C# compiler ever sees it. Developers write familiar-looking component syntax and the tool handles the translation step automatically during the build. The translation is handled by a Roslyn source generator, which is the official Microsoft mechanism for generating extra C# code at build time. The .csmx files are treated as additional inputs to the build, and the generated C# appears as part of the normal compilation process. This means the rest of the project's C# files can reference names and types defined in .csmx files without any workarounds. Editor support currently covers Visual Studio Code only. A custom language server provides syntax highlighting, error checking, hover information, and code completion for tag names and attributes inside .csmx files. For ordinary C# features like go-to-definition, the extension forwards requests to the existing C# extension already installed in the editor. The project ships with sample applications demonstrating three different ways to translate tags to code: factory mode, where tags become calls to a generic element function, direct-call mode, where component tags call a function directly, and fluent mode, where tags build up an object through method chaining. The README notes that JSX fragments and spread attributes are not yet supported, and describes the whole project as a minimal proof of concept rather than a production-ready tool.

Copy-paste prompts

Prompt 1
Help me clone and build this repo's samples to try the JSX-like C# syntax.
Prompt 2
Explain how CSMX turns a tag like <stack><text>Hello</text></stack> into plain C#.
Prompt 3
What is the difference between factory mode, direct-call mode, and fluent mode in this project?
Prompt 4
Walk me through installing the CSMX VS Code extension for editor support.

Frequently asked questions

What is csharp-markup-extension?

A proof-of-concept that brings JSX-like tag syntax from React into C#, letting developers write HTML-like markup that a build-time tool turns into normal C# code.

What language is csharp-markup-extension written in?

Mainly C#. The stack also includes C#, .NET, Roslyn.

What license does csharp-markup-extension use?

The explanation does not state the project's license.

How hard is csharp-markup-extension to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is csharp-markup-extension for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.