Auto back-up VS2005 workspace

2

All too often VS2005 will crash when compiling and I'll have to re-open it. That's all well and good, a minor inconvenience really. But the annoying part is that it remembers the opened files from the last time I manually closed VS2005 and not the files that were open when it crashed.

Is there some way to back up my current workspace (the open files) so when it crashes and I reload it, it will remember what I had open?

Enigma

Posted 2013-02-25T19:40:59.997

Reputation: 3 181

I don't know for sure, as there may be a way to hack it, but in general probably not, as the tabs to open next time are saved at the time of a proper shutdown of VS. – Ƭᴇcʜιᴇ007 – 2013-02-25T19:52:04.810

Any way to emulate this activity and put it on a scheduler? Happen to know where this is saved to? – Enigma – 2013-02-25T19:53:26.727

I think it's saved in the .SUO (Solution User Options) of the solution that was open when you closed VS. Check this out for some ideas perhaps?

– Ƭᴇcʜιᴇ007 – 2013-02-25T20:00:16.440

Doesn't really help me as I don't know how I'd use it but it is informative. – Enigma – 2013-02-25T20:12:57.207

I think given the info from techie007's link, it might be useful to enquire on SO as to how (if it's even possible) you can send messages to VS to trigger the SaveUserOptions method on demand. – Karan – 2013-02-26T01:14:34.667

Answers

0

Potentially relevant information from techie007's link:

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.

Enigma

Posted 2013-02-25T19:40:59.997

Reputation: 3 181