Visual Studio 2010 closing confirmation

I want VS2010 to ask me when I close the whole environment, whether I am sure of closing VS2010 or not.

Unfortunately, I could not find this setting anywhere

Somebody knows?

+8
visual-studio-2010
source share
2 answers

AFAIK, there is no such option. However, there is an old tool called NoClose that can disable the (X) button for you (see LifeHacker 's article on this tool)

Although I have not used it under Windows 7/8, I am not sure if it is compatible.

+1
source share

I have not tried this in Visual Studio 2010, but you can achieve this in Visual Studio 2008 with at least an automation macro. The instructions below work in 2008 and should not be too complicated to translate to 2010 (hopefully).

Open the IDE macro (Tools-> Macros-> MacroIDE), and in the list of Macros you will see the EnvironmentEvents element. Double-click this to get a module containing environment event macros.

Select SolutionEvents drop-down list, and then select QueryCloseSolution from the Declarations list. We make a macro that runs whenever you try to close a solution. We will create a message box to ask the user if they want to do this, and possibly cancel the shutdown - you should get something like this:

 Private Sub SolutionEvents_QueryCloseSolution(ByRef fCancel As Boolean) Handles SolutionEvents.QueryCloseSolution If (MsgBox("Close the solution?", MsgBoxStyle.OkCancel) = MsgBoxResult.Cancel) Then fCancel = True End Sub 

Save the Macro project, try closing the solution, or turn off Visual Studio. If the stars are aligned, you will see a confirmation window. If you click Cancel, the solution will not be closed, and VS will not shut down.

Now, maybe someone can confirm in the comments if this works for VS2010?

+1
source share

All Articles