views:

92

answers:

4

I work in a solution with many projects. Often, I need to recompile and it takes a minute or two, so I tend to switch to a web browser to kill that time. Sometimes I forget to look back and the build succeeded a few minutes before I noticed.

Is it possible to somehow get Visual Studio (just UI version, not command line) to beep at me if the build (for the project or solution) completes successfully without warning?

Also helpful would be a beep when the first breakpoint is hit while debugging, since sometimes I have to wait a minute or two for this to happen as well.

Do I need to write a macro for it, perhaps? Are there hidden settings somewhere?

Thanks in advance,

-an accidental procrastinator

+3  A: 

Here is a macro found at: http://elegantdevelopment.blogspot.com/2009/09/visual-studio-2008-macro-fun.html

Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
   If (Not failed) Then
      ' System.Windows.Forms.MessageBox.Show("Build is complete!")
      Beep()
      Threading.Thread.Sleep(250)
      Beep()
   End If
End Sub

Good luck!

Kevin Crowell
+1  A: 

I think the easiest way is to do the following

  • Create a simple command line app that calls the Win32 Beep function
  • Setup a post build event to run on build success
  • Call that App
JaredPar
+1 or even just a batch file instead of an app: http://forums.whirlpool.net.au/archive/564510
joelt
I don't really want to modify the post-build properties for every project to achieve this - sometimes I am building different projects that have pre-requirements for others to be built - that could trigger all kinds of premature beeps if I had to have each one contain a post-build event that calls a win32 beeper app.
Mike Atlas
+1  A: 

I used to use the event toaster for visual studio which display events in the system tray, I used it for builds because I too got bored waiting for builds :) Not used it in a while though.

Paulie Waulie
This looks promising.
Mike Atlas
I used this for my needs since my machine is a VM with Win2k8 server on it and unfortunately no sound device available (system beeps are the only thing that make it back to my physical box).
Mike Atlas
+2  A: 

I'm seeing in my System Sounds a category called "Microsoft Visual Studio Macros" that contains three sounds: Build Canceled, Build Failed, and Build Succeeded. I'm guessing they got there from the sample macros that get installed by default. Might try hitting Alt-F8 in VS and poking around in the macros.

My favorite solution is this one though: VSBuildStatus. If you've got Windows 7, it will show the build progress in the taskbar (like Explorer does with file copying). Turns red on a build failure. Must-have.

http://visualstudiogallery.msdn.microsoft.com/en-us/2A2293B4-1808-44AA-B030-661F6803D8A1

Scott Bilas
Aww, this is neat (system sounds, didn't think to look there). Unfortunately, I'm using Win2k8 VM, and there is no sound device installed (for playing .wav files) and the taskbar don't look as pretty without Aero installed :/
Mike Atlas