While we are in dev and doing daily builds, we would like to display the current version number on the footer of the pages in our MVC3 app. Makes it easier for the QA to log bugs.
I'm not sure how to do this. The footer is in the shared _layout.cshtml page.
I would like to use (Assembly.GetExecutingAssembly().GetName().Version.ToString()) to display it. I thought about using ViewData but still not sure how to format the HTML to get it to display.
Since you just need it in dev, you could simply do
<footer>
@System.Reflection.Assembly.GetExecutingAssembly().GetName().Version
</footer>
This used to work back in the day (i think).
Now it indeed does not, so use this instead (from the answer linked in the comment):
@typeof(YourApplicationNamespace.MvcApplication).Assembly.GetName().Version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With