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”:

image

We use following post-build event setting:

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


image


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


image


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


Enjoy!

3 comments:

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)
pane.Activate()
pane.OutputString(message)
pane.OutputString(Environment.NewLine)
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