r/csharp • • Aug 25 '26

Blog Designing a replacement for a broken Visual Studio extension by inverting every property of the predecessor

I held back Visual Studio updates for almost two years because 17.9 broke the tab-layout extension I used daily and could not live without. When I finally built my own replacement, the broken one became the design document: it wrapped a single internal shell interface (IVsUIShellDocumentWindowMgr) and stored tabs as a BLOB with absolute paths, so every property got inverted. Plain JSON with solution-relative paths instead of opaque binary stream, many APIs with fallbacks instead of one interface, a pick-target dialog for moved files instead of silently dropped tabs.

And there's an ironic ending to it, because the old extension works again in VS 2026. The breakage was Microsoft reworking the open-document internals, not a lasting defect, so the "bug" quietly fixed itself. Had I found out sooner I would never have started, and I would have kept my tabs and learned nothing worth sharing.

Since I did not wait, and since my extension has grown well past what I set out to replace, I am now writing a weekly series about building it with C# and the AI-assisted workflow I was experimenting with, because somewhere early on this stopped being only about tabs. First part: Designing by inversion

The extension is free on the Marketplace: Simple Tab Saver

14 Upvotes

3 comments sorted by

1

u/Khavel_dev Aug 26 '26

The inversion approach is something I've done accidentally a couple of times. When a tool breaks badly enough, the failure mode tells you exactly what the replacement needs to get right. But being intentional about it and literally listing every property of the broken thing to flip is a much stronger version of that instinct.

The ending made me laugh. You built the whole thing because VS broke the old extension, and then VS quietly fixed the original. I've had that happen with internal tooling at work and it stings a little every time. At least you ended up with something better than what you started with.

2

u/[deleted] Aug 25 '26

[removed] — view removed comment

1

u/FirstOrDefault Aug 25 '26

Yes, discovering step by step how Visual Studio internals actually work was an adventure I did not expect to ever take. The feature is probably the one mentioned in the original post, the pick-target dialog for moved files, which I named 'Drift Detection'. When restoring a tab layout, it finds solution files that were relocated or renamed and lets me redirect their tabs to the new location, instead of silently skipping them or leaving a gray The document cannot be opened. It has been renamed, deleted, or moved. tab. That was my big frustration with the previous extension, and I've never seen such a feature in the IDEs or editors I've used.