views:

136

answers:

2

When I open a solution in VS 2008, I don't want it to open all the files that I had open last time. I just want it to open the solution. Can't see a config option for this, is it possible?

+1  A: 

You can automate the process of closing all the files prior to closing a solution by adding a handler for the BeforeClosing event of EnvDTE.SolutionEvents -- this will get invoked when VS is exiting.

In VS2005, adding the following to the EnvironmentEvents macro module will close all open documents:

Private Sub SolutionEvents_BeforeClosing() Handles SolutionEvents.BeforeClosing
    DTE.ExecuteCommand("Window.CloseAllDocuments")
End Sub

Visual Studio 2008 appears to support the same events so I'm sure this would work there too.

I'm sure you could also delete the .suo file for your project in the handler if you wanted, but you'd probably want the AfterClosing event.

Bob Dizzle