Improve company productivity with a Business Account.Sign Up
The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
The solution user options (.suo) file is a structured storage, or compound, file stored in a binary format. You save user information into streams with the name of the stream being the key that will be used to identify the information in the .suo file.
When the environment opens a .suo file, it enumerates all currently loaded VSPackages. If a VSPackage implements the IVsPersistSolutionOpts interface, then the environment calls the LoadUserOptions method on the VSPackage asking it to load all of its data from the .suo file.
It is the VSPackage's responsibility to know what streams it might have written into the .suo file. For each stream that it wrote, the VSPackage calls back to the environment through LoadPackageUserOpts to load a particular stream that is identified by the key, which is the name of the stream. The environment then calls back to the VSPackage to read that particular stream passing the name of the stream and an IStream pointer to the LoadPackageUserOpts method.
At that point, another call is made to LoadUserOptions to see if there is another section of the .suo file that has to be read. This process continues until all of the data streams in the .suo file have been read and processed by the environment.
When the solution is saved or closed, the environment calls the SavePackageSolutionProps method with a pointer to the SaveUserOptions method. An IStream containing the binary information to be saved is passed to the WriteUserOptions method, which then writes the information to the .suo file and calls the SaveUserOptions method again to see if there is another stream of information to write to the .suo file.
These two methods, SaveUserOptions and WriteUserOptions, are called recursively for each stream of information to be saved to the .suo file, passing in the pointer to IVsSolutionPersistence. They are called recursively to allow for the writing of multiple streams to the .suo file. In that way, user information is persisted with the solution and is guaranteed to be there the next time the solution is opened.
Author Closing Comment
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Join the community of 500,000 technology professionals and ask your questions.
Join & Ask a Question
Join our community for more solutions or to ask questions.
For immediate help use Live now!