0

Hi i want to ask that when we build our project in VS we know that exe get automatically created but my client wants that exe with version number and every time i click on build and the new exe will create with the newer version number.So is there any possibility for this version writing ,i think "no" as i have never seen any exe with version number ?So please clear my confusion .However ,i know that when we publish our software it creates "Publish version " for us but my client do not want publish he wants just exe !!

TheSpy
  • 265
  • 1
  • 8
  • 21
  • in your application properties you have `Assembly information...` button. There you can set version numbers. Is it what you are looking for? – Milan Halada Apr 29 '14 at 07:48
  • I think it could not automatically create version number for exes?Is that so ? – TheSpy Apr 29 '14 at 08:01
  • http://stackoverflow.com/questions/356543/can-i-automatically-increment-the-file-build-version-when-using-visual-studio – Milan Halada Apr 29 '14 at 08:06
  • 1
    You need to start seeing it first. Right-click your EXE, Properties and click on the Details tab. The version number you see there is generated by the [AssemblyFileVersion] attribute in your AssemblyInfo.cs source code file. No, auto-incrementing it is not supported. – Hans Passant Apr 29 '14 at 10:36
  • @HansPassant No auto-incrementing, but unique number based on date and time – Xaruth Apr 29 '14 at 12:12
  • @Xaruth - No, you are talking about the [AssemblyVersion] attribute. It indeed auto-increments by using the current date and time. But you can't see the value in Windows, the Details tab doesn't display it. Try this to see this for yourself. So it is of no use to this demanding customer. – Hans Passant Apr 29 '14 at 12:25
  • I must have not understand correctly his question. Nowhere in Visual Studio we can see current version auto-generated, but we can see it on properties of generated exe. – Xaruth Apr 29 '14 at 12:44

1 Answers1

2

In the AssemblyInfo.cs file, change :

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

by

[assembly: AssemblyVersion("1.0.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

(that will change last number with a number in relation with when you build (time only))

or

[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

(that will change 2 lasts numbers with a number in relation with when you build (date.time))

Xaruth
  • 4,034
  • 3
  • 19
  • 26