Skip to content

C#/ASP.NET Core: attribute routing produces no Route nodes (breaks cross-repo-intelligence) #1162

Description

@GishReloaded

Summary

No Route nodes are extracted from C# / ASP.NET Core controllers. Attribute routing is not recognized in any of its common forms, so label=Route returns zero results for an ASP.NET backend.

This silently breaks index_repository(mode='cross-repo-intelligence'): a JS/TS client that calls the backend does get its Route nodes extracted, but there is nothing on the server side to match them against, so the run reports total_cross_edges: 0 and looks like "these repos are unrelated" rather than "one side failed to parse".

Repro

Minimal project — a single file, Controllers/ClientController.cs:

using Microsoft.AspNetCore.Mvc;

namespace Repro.Controllers
{
    [ApiController]
    [Route("api/v1/client")]
    public class ClientController : ControllerBase
    {
        // Style A: separate [HttpPost] + [Route("...")]
        [HttpPost]
        [Route("login")]
        public IActionResult Login() => Ok();

        // Style B: combined verb+template
        [HttpGet("ping")]
        public IActionResult Ping() => Ok();

        // Style C: class-level route only, verb without template
        [HttpDelete]
        public IActionResult Remove() => Ok();
    }
}

Then:

codebase-memory-mcp cli index_repository '{"repo_path":"<path>","name":"aspnet-route-repro"}'
codebase-memory-mcp cli search_graph   '{"project":"aspnet-route-repro","label":"Route"}'

Expected

Three Route nodes, with the class-level [Route("api/v1/client")] prefix composed with each method template:

  • POST /api/v1/client/login
  • GET /api/v1/client/ping
  • DELETE /api/v1/client

Actual

{"total":0,"results":[],"has_more":false,
 "hint":"No nodes with this label. Available labels: Function, Method, Class, Interface, Route, Variable, Module, Package, File, Folder."}

Indexing itself succeeds (nodes: 13, edges: 19) and the controller methods are present as Method nodes — only the route extraction is missing. All three attribute styles fail, so this does not look like an edge case in template parsing but rather that ASP.NET attribute routing is not handled at all.

Impact on a real setup

In a four-repo setup (ASP.NET Core backend + Electron launcher + two clients):

Repo label=Route count
Electron launcher (JS/TS) 2 — correctly extracted, e.g. /api/v1/client/login
ASP.NET Core backend (C#) 0

The backend does define the matching endpoint via standard attribute routing, and it is found normally through search_graph(query=...) as a Method node — it simply never becomes a Route. cross-repo-intelligence across all projects returns total_cross_edges: 0.

Environment

  • codebase-memory-mcp 0.9.0 (release binary)
  • Windows 11, amd64
  • Backend targets ASP.NET Core, Microsoft.AspNetCore.Mvc attribute routing

Notes

C# is listed among the Hybrid LSP semantic languages and HTTP route matching is a documented feature, so this looks like a gap rather than intended behavior. Happy to test a patch against the repro above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existsparsing/qualityGraph extraction bugs, false positives, missing edgespriority/normalStandard review queue; useful PR with ordinary maintainer urgency.windowsWindows-specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions