1

It's not anything critical, but when working on projects all day long, we know when code changes happen, but there's currently no way of knowing when the last publish happened. Is there some kind of way to modify the build file to dump a time stamp to the output window when building? https://i.sstatic.net/ZHM2i.png

i've tried this in the csproj file

<PostBuildEvent> <Command>ECHO ============ %TIME% ============</Command> <Message>build time</Message> </PostBuildEvent>

and i've tried time /t for the command.

8
  • 1
    Add a Post Build Event that simply runs time /t? Commented Aug 29, 2019 at 15:49
  • could you give more detail on how i would do that? Would it go in the build file? Commented Aug 29, 2019 at 15:50
  • 1
    learn.microsoft.com/en-us/visualstudio/ide/… Commented Aug 29, 2019 at 15:52
  • 1
    Some project types don't include editors for post-build events. However, you can still hack the project file to insert them. My time /t is simply the CMD.exe command (there's a similar date /t command) Commented Aug 29, 2019 at 15:58
  • i'm editing the question to show what i have tried. It's not working. Commented Aug 29, 2019 at 16:03

1 Answer 1

1

The solution was thanks to all commenters but nobody posted an answer so here you go.

In your solution properties > build events (yes it's on a per-solution basis, unfortunately), add this line:

ECHO ######%TIME%######

this will place the build time in the build output. However, in my case this wasn't good enough since it got lost in all the file copying that happened afterwards since it's a web project. My ideal solution was a popup. Final solution:

file: msgbox.vbs in your c:\ directory:

Set objArgs = WScript.Arguments
messageText = objArgs(0)
MsgBox messageText, , "Last Publish Time"

and then in your solution properties build events (set to always),

taskkill /fi "WINDOWTITLE eq Last Publish Time"
START c:\msgbox.vbs %TIME%

What this does is launch msgbox.vbs asynchronously (START) with the time, but since i want this automatic i first call taskkill to close the previous display. Now whenever i want to view my last publish time, i merely have to mouse over the WSH icon.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.