0

I'm working on an MVC site with a team and I'd like to display the last publish timestamp and the name of the user that last publsihed within a comment inside of the _Layout.cshtml page while we're in development. I'm open to packages or msbuild tasks to achieve this, but I'm not positive on the best direction. Right now, I'm able to display a last build time in this fashion:

<!--
Last Built on: @File.GetCreationTime(ViewContext.Controller.GetType().Assembly.Location)
Last Built by: //desired output similar to: jsmith
-->

The file ownership of the assembly shows the IISAppPool account.

mckennawebdev
  • 547
  • 1
  • 5
  • 17
  • The last time what exactly was published? The content in the razor view, some content from the database, the assembly or something else? – Professor of programming Jun 18 '15 at 20:46
  • How do you publish your website? is it done through a build server? or a deployment script? or right click on the project and select "Publish" using a publish profile? – Aram Jun 18 '15 at 21:25
  • This is a job for a build server. Look into something like TeamCity, Cruise Control, Team Foundation Server, or Visual Studio Online. – Pete Jun 18 '15 at 21:47
  • Bonner - Last time the application was published to the QA server. Pete and Aram - Unfortunately, this employer does not utilize a build server so we're publishing from local to a QA server for testing. Last place I worked, we used a build server that had this functionality custom built into it. Is there a way to do something similar with an MSBuild task? String replace a variable in _Layout.cshtml to leave an HTML comment of the username? – mckennawebdev Jun 18 '15 at 22:50

0 Answers0