SWE-Sharp-Bench: A Reproducible Benchmark for C# Software Engineering Tasks

Sanket Mhatre, Yasharth Bajpai, Sumit Gulwani, Emerson Murphy-Hill, Gustavo Soares

TL;DR

SWE-Sharp-Bench is the first repository-level software engineering benchmark designed specifically for the C# and .NET ecosystem, featuring 150 high-quality tasks from 17 open-source repositories. Evaluation of state-of-the-art AI coding agents reveals a stark performance gap: while identical agent configurations solve up to 70% of Python tasks, they resolve at most 40-47% of C# tasks due to the language's higher structural and patch complexity.

What Problem Does This Paper Address?

While AI coding agents have made massive strides on Python-centric benchmarks like SWE-Bench, prominent enterprise languages have been largely neglected. C# ranks #5 on the TIOBE index and dominates enterprise software development, yet the entire .NET ecosystem has been completely absent from repository-level evaluation frameworks.

Evaluating C# is uniquely challenging due to .NET's architectural complexity. Unlike the relatively flat structure of Python packages, C# projects utilize a hierarchical system of solution files (.sln) and project files (.csproj). They frequently employ "multi-targeting"—compiling a single codebase for multiple .NET versions simultaneously—and rely on sophisticated dependency management (NuGet) and various testing frameworks (NUnit, xUnit, MSTest). This paper bridges the gap by introducing an automated, reproducible pipeline to evaluate AI agents on real-world C# software engineering problems.

Methods

The authors built a 5-step curation pipeline adapted from SWE-Bench's methodology but engineered to handle .NET-specific hurdles:

  1. Repository Selection: Filtered the top 100 C# GitHub repositories to find active codebases with over 5,000 stars and verified build viability.
  2. PR Scraping & Filtering: Scraped the 1,000 most recent Pull Requests (PRs) per repo, keeping only those linked to a GitHub issue that modified test files and were successfully merged.
  3. Environment Determination: Automatically generated a Dockerfile for each PR by parsing configuration files (.github/workflows, *.sln, *.csproj, global.json, and .env) to resolve complex NuGet dependencies and multi-targeting conflicts.
  4. Execution-Based Filtering: Validated reproducibility by running tests across three states (base commit, base + test patch, and base + test + fix). Only PRs exhibiting a strict pass → fail → pass behavior were retained to eliminate flaky tests.
  5. Manual Verification: The first two authors independently annotated and cross-checked candidate PRs to filter out underspecified problem statements or inadequate test cases.
Fig. 1: Curation pipeline

Datasets

The paper introduces SWE-Sharp-Bench, consisting of 150 curated issue-resolving instances from 17 popular C# repositories. The dataset spans various domains including Data & Storage, API Infrastructure, User Interfaces, and Development Tools. For cross-language comparisons, the authors evaluated identical agent configurations against SWE-Bench Verified (Python) and Multi-SWE-Bench (Java).

Key Insights and Ideas

  • High Patch Complexity: C# codebases exhibit significantly more complex static patch properties than Python or Java. C# fixes have the broadest distribution of modified files (mean of 4.88 files vs. Python's 1.24) and a much higher number of lines and hunks per patch, often involving coordinated multi-file edits and refactoring.
  • Terse Problem Specifications: C# issue descriptions are frequently under 150 tokens, compared to Java issues which can exceed 1,600 tokens. This leaves AI agents with far less explicit context to locate and resolve bugs.
Fig. 2: Distribution of #Files, #Hunks and #Lines in Patches across Languages
  • The Python Advantage: Using logistic regression, the authors controlled for patch complexity and model choices. They confirmed that even when patch sizes are identical, Python tasks are inherently easier for current LLMs to resolve than C# or Java tasks, highlighting a potential training data or architectural bias toward Python.

Key Results

The authors evaluated leading models from OpenAI and Anthropic using two popular open-source agent frameworks: SWE-Agent and OpenHands.

  • Top Performers: The highest resolution rate was achieved by OpenHands + GPT-5 at 47.3%, closely followed by SWE-Agent + Claude 4 Sonnet at 44.7%.
  • Generation Gaps: Clear progress was visible across model generations. For instance, GPT-4o struggled significantly, scoring only 8.0% (OpenHands) and 11.3% (SWE-Agent), whereas newer reasoning models like o3 reached up to 35.0%.
  • Cross-Language Comparison: For an identical setup (SWE-Agent + Claude Sonnet 3.7), the resolution rate was 62.40% for Python, 30.67% for C#, and 14.68% for Java, underscoring that strongly-typed, structurally complex languages remain a formidable challenge for AI agents.

Limitations and Future Work

The authors note a few limitations:

  • At 150 instances, SWE-Sharp-Bench is smaller than the full SWE-Bench Verified dataset (500 instances), though it remains comparable to individual language subsets in Multi-SWE-Bench.
  • Unlike SWE-Bench Verified, it currently lacks manual annotations categorizing task difficulty.
  • As with any benchmark built from public data, there is a risk that parts of the dataset may be included in the training mixtures of future LLMs.

Future work includes scaling the benchmark and exploring how specialized toolsets can help agents better navigate complex .NET solution structures.

Summary updated

BibTeX
@misc{mhatre2025swe,
  author = {Sanket Mhatre and Yasharth Bajpai and Sumit Gulwani and Emerson Murphy-Hill and Gustavo Soares},
  title = {{SWE-Sharp-Bench: A Reproducible Benchmark for C\# Software Engineering Tasks}},
  year = {2025},
  eprint = {2511.02352},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.02352},
}
Figure