Wednesday, April 06, 2011

Display last “build completed” time in Visual Studio 2008/2010

The build process in VS08/10 doesn’t display by default the timestamp of the “build completed”:


We use following post-build event setting:

[your code if necessary]
echo build completed
time /t


This generates a timestamp in output window displaying the time when the build was completed:


So you can see if you are dealing with most recent build.



Anonymous said...

Awesome, something I was looking for.

sotto said...

Hey Mike,

great idea! i'd only implement it in a macro... =>for all projects enabled automatically!
(i have this in MyMacros EnvironmentEvents )

Public Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildDone
Write("Build", Now)
End Sub

Private Sub Write(ByVal name As String, ByVal message As String)
Dim output As Window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
Dim window As OutputWindow = output.Object
Dim pane As OutputWindowPane = window.OutputWindowPanes.Item(name)
End Sub

winmike said...

@sotto: good idea, but.. if you get the project on another workstatio, you have to import the macros too. otherwise it wouldn't work. once you have the datetime stamp output in project setting - you are machine-independent