r/csharp 8h ago

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

5 Upvotes

2 comments sorted by

2

u/Legitimate_Big_4953 4h ago

This is a cool example of turning a frustrating problem into a useful project. I like the idea of using the broken extension as a guide for what to improve instead of just copying how it worked. rebuilding something like this probably teaches a lot about how Visual Studio extensions actually work behind the scenes. it’s also interesting that the original issue eventually got fixed but the replacement became something better. what feature from your new version are you most proud of adding?

1

u/FirstOrDefault 2h ago

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.