Today I was trying to determine how to display the version number entered into the Options dialog on a razor pages solution.

Environment: Although I dont think it matters, I am using Visual Studio on a Mac.

Description: If you right click the solution note in a Visual Studio solution, there is an Options menu item. Clicking that leads to a dialog where there is an entry box for entering a version number. In the project under the solution, there is an Options menu there to, and there is a checkbox to let it take its version number from the solution version number.

This version number is stored in the .CSPROJ configuration file for the project.

I tried to find a way to display this version number on a page in my app.

I spent at least a couple of hours, and had to read about 20 webpages for a solution. It turns out there probably is not a way to get the app to display that version number, because that version number apparently does not get baked into the app when it is published. However, there are some other version numbers that can be displayed.

The article that gave me the solution I needed was “Get App Version” in .NET Core https://edi.wang/post/2018/9/27/get-app-version-net-core

I didnt need this article, but it looks like it describes a useful solution I may need in the near future regarding version prefixes and suffixes.

Google queries I tried:

  • applicationversion always shows 1.0.0.0 razor pages
  • applicationversion always shows 1.0.0.0
  • assemblyinfo.cs not showing version number from csproj
  • razor pages ApplicationVersion always showing 1.0.0.0
  • razor pages display solution ReleaseVersion number
  • razor pages “project ReleaseVersion” number
  • razor pages “project release version” number
  • razor pages “project version” number
  • razor pages project version number

Some microsoft pages I looked at:

Some other pages I looked at:

programming/net_core/razor_pages/how_to_display_a_configuration_file_version_number_in_a_razor_pages_.net_core_web_app.txt · Last modified: 2020/03/25 02:28 by adminuser
Powered by PHP Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 Valid HTML5