.net - I want to show the current BUILD info on my title bar -
i want show current build info on title bar. (main_form.txt).
i have seen several references finding it, none giving me data want.
my project simple visual studio express 2015, win forms app .net 4.5
when in properties/publish see build currenly 1.0.0.13 , increase each publish do.
where can variables ?
i see in bbox2.exe.manifest file following line....
asmv1:assemblyidentity name="bbox2.exe" version="1.0.0.13" publickeytoken="1d053a5b342cefc4" language="neutral" ........
i have tried suggested in post following..
dim ass system.reflection.assembly = system.reflection.assembly.getexecutingassembly() dim ver system.version = ass.getname().version me.text = ("blacbox" & ver.major & "." & ver.minor & "." & ver.revision & "." & ver.build)
but gets me 1.0.0.0 ??
any , advice appreciated.
the publish version
usable when publish application using click once, otherwise can use value of assemblyversion
in assemblyinfo.vb
under my project
folder.
like publish version, can set assembly version increase automatically using <assembly: assemblyversion("1.0.*")>
or <assembly: assemblyversion("1.0.0.*")>
can change major, minor, , build versions suitable values.
you can create property returns version string way:
public readonly property applicationversion version if (applicationdeployment.isnetworkdeployed) return applicationdeployment.currentdeployment.currentversion else return assembly.getexecutingassembly().getname().version end if end end property
don't forget add reference system.deployment
assembly , add import namespace code:
imports system.deployment.application
then can use:
me.text = applicationversion.tostring()
or show version in custom format, can use major
, minor
, build
, revision
, example show version build number:
me.text = string.format("{0}.{1}.{2}", _ applicationversion.major, applicationversion.minor, applicationversion.build)
edit
so should use assemblyversion
in assemblyinfo.vb
under my project
folder , make auto increment changing <assembly: assemblyversion("1.0.*")>
. can version way:
me.text = assembly.getexecutingassembly().getname().version.tostring()
don't forget imports system.reflection
Comments
Post a Comment