27

Are there any free tools available to view the contents of the solution user options file (the .suo file that accompanies solution files)?

I know it's basically formatted as a file system within the file, but I'd like to be able to view the contents so that I can figure out which aspects of my solution and customizations are causing it grow very large over time.

Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
Joseph Daigle
  • 47,650
  • 10
  • 49
  • 73

6 Answers6

33

A bit late for the original poster, but maybe useful to others.

Two freeware viewers for structured storage files (including .suo-files):

https://github.com/ironfede/openmcdf (old URL: http://sourceforge.net/projects/openmcdf/)

http://www.mitec.cz/ssv.html (free for non-commercial use)

When you open a .suo file in one of these viewers, you will see streams related to:

  • Bookmarks
  • Debugger watches
  • Unloaded projects
  • Outlining
  • Task-list user tasks
  • Debugger exceptions
  • Debugger Breakpoints
  • Debugger find source data
  • Open document windows

And much more...

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
frank koch
  • 1,138
  • 2
  • 14
  • 27
12

The .SUO file is effectively disposable. If it's getting too large, just delete it. Visual Studio will create a fresh one.

If you do want to go poking around in it, it looks like an OLE Compound Document File. You should be able to use the StgOpenStorage function to get hold of an IStorage pointer.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
4

I'm not aware of a tool, but you could write a Visual Studio extension to list the contents without too much work.

If you download the Visual Studio SDK, it has some straightforward examples that you can use. Find one that looks appropriate (like maybe the Toolwindow, if you want to give yourself a graphical display) and lift it (for your own personal use, of course).

What makes it easy is that the Package class which you implement in any VS extension, already implements the IVSPersistSolutionOpts, as aku mentioned. So you can just call the ReadUserOptions method on your package and inspect the contents.

Darcy Casselman
  • 2,574
  • 3
  • 24
  • 26
1

You can use the built in tool that comes with OpenMCDF, which is called Structured Storage Explorer. It doesn't allow you to see all the details, but allows you to see all the individual settings and their sizes. In order to see the actual settings, you need to format the bytes as UTF-16.

Reference: https://github.com/ParticularLabs/SetStartupProjects

helios456
  • 1,624
  • 16
  • 24
1

I don't know any tool, but you can try to access user settings via IVsPersistSolutionOpts interface

aku
  • 122,288
  • 32
  • 173
  • 203
  • Do you know by any chance, on what to pass for the `IStorage` parameter of the [`ReadUserOptions`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.interop.ivspersistsolutionopts.readuseroptions?view=visualstudiosdk-2019#Microsoft_VisualStudio_Shell_Interop_IVsPersistSolutionOpts_ReadUserOptions_Microsoft_VisualStudio_OLE_Interop_IStream_System_String_) method? – Twenty Feb 21 '20 at 11:20
1

I created an open source dotnet global tool for this:

dotnet install --global suo
suo view <path-to-suo-file>

More information at https://github.com/drewnoakes/suo

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742