Hi devs.
I’m a C# developer working mostly with large enterprise .NET solutions.
Over the last few months I’ve been building something that completely changed how I use AI for coding.
The idea is simple:
👉 Stop letting AI edit code as plain text.
👉 Let AI work with real program structure.
Because on real projects — the usual AI workflow breaks very fast.
If you’ve tried using AI on big .NET solutions, you probably saw this:
AI reads entire files just to change one method
misses overloads and hidden dependencies
breaks partial classes
generates syntax that compiles “by luck”
wastes huge token context on irrelevant code
This is fine for scripts.
But on enterprise solutions with hundreds of files — reliability drops quickly.
So I changed the architecture.
💡 Connecting AI directly to the Roslyn compiler
Instead of text diffs, I built an MCP server that exposes structured OOP tools.
Now AI can request a semantic model like:
solution → projects → namespaces → classes → members
It can also query:
inheritance trees
interface implementations
method overloads
call graphs
references and usages
So AI doesn’t “guess”.
It works with compiler-verified structure.
Example tasks AI can perform:
create a class implementing an interface
safely rename a member
add methods with correct signatures
refactor code using Roslyn transformations
instantly receive diagnostics
All syntax is generated by Roslyn — not by prompt magic.
🧠 Context efficiency on large projects
Instead of loading massive files into prompts, AI requests only the exact structured data it needs.
On big solutions this improves:
speed
precision
token usage
refactoring safety
This was one of the biggest practical wins.
🐞 Runtime control: debugger + UI automation
Then I went further.
The extension now allows AI to control Visual Studio and the running application:
build and run projects
attach debugger
set breakpoints
step through execution
inspect locals
automate UI (click buttons, fill forms, capture screenshots)
So AI can actually test what it writes.
In the demo below AI creates a full WinForms app using SOLID architecture, then runs and tests it through UI automation.
🎬 Demo video:
https://www.youtube.com/watch?v=skvnHbm2lpk
🔌 Works with multiple AI assistants
The extension uses MCP, so it works with:
Claude Code
GitHub Copilot
OpenAI Codex
Cursor
other MCP-compatible agents
I also ported the Claude Code chat UI into Visual Studio (still beta), so everything can run inside one IDE window.
📦 Availability
Previous versions are free and open:
GitHub:
https://github.com/yarhoroh/RoslynMCP-Public
Visual Studio Marketplace:
https://marketplace.visualstudio.com/items?itemName=YaroslavHorokhov.RoslynMcp
If you’re working with large C# solutions and experimenting with AI —
I’d genuinely love to hear your feedback.
What would you want AI to control inside the IDE?
Top comments (0)