asp.net - Get version number of my website -


the website old aspx website. running under c# 4.5 using visual studio 2013 if helps.

my assemblyinfo.cs file has following in it.

[assembly: assemblyversion("1.0.*")] 

i have taken out assemblyfileversion attribute.

on default.aspx file have following;

site version: <%= system.reflection.assembly.getexecutingassembly().getname().version.tostring() %> 

however version displayed 0.0.0.0.

i have followed sample on , http://abundantcode.com/how-to-get-auto-incrementing-version-number-in-visual-studio-2013/ still 0.0.0.0

any idea on doing wrong?

edit:

try this:

typeof(yourmainclass).assembly.getname().version 

you can try this:

var str = httpcontext.current.applicationinstance; assembly assem = str.gettype().basetype.assembly; system.version assemblyversion = assem.getname().version; 

or this:

var ver = assembly.getassembly(page.gettype().basetype).getname().version; 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -