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
Post a Comment