Visual Studio 2013 Version Number

Active3 months ago
  1. Visual Studio 2010 Version Numbers
  2. Visual Studio 2013 Update 4 Version Number
  3. Visual Studio 2013 Version Number

I was just wondering how I could automatically increment the build (and version?) of my files using Visual Studio (2005).

Visual Studio.NET 2003 = version 7.1 Visual Studio 2005 = version 8 Visual Studio 2008 = version 9 Visual Studio 2010 = version 10 Visual Studio 2012 = version 11 Visual Studio 2013 = version 12 Visual Studio 2015 = version 14 Visual Studio 2017 = version 15 Visual Studio 2019 = version 16. The number on the icon indicates the version that the.

  • Within Visual Studio line numbers are not enabled upon the first install. This wiki will show you how to enable them for C# and any other language. The steps listed are for Visual Studio Community 2013 edition but are transferable to all newer versions of Visual Studio. Open Visual Studio. Click Tools Options.
  • The internal version number of Visual Studio 2008 is version 9.0 while the file format version is 10.0. Visual Studio 2008 is the last version to support targeting Windows 2000 for C applications. Visual Studio 2008 is focused on development of Windows Vista, 2007 Office system, and Web applications.
  • 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.
  • How to check which update installed on Visual Studio 2013. The About page does display this information in the Version number. 12.0.21005.1 REL is the release version. Update 5 is 12.0.40629.0: In fact, you don't need to check the version. You can have Visual Studio check for any updates itself by going to Tools Extensions & Updates.

If I look up the properties of say C:Windowsnotepad.exe, the Version tab gives 'File version: 5.1.2600.2180'. I would like to get these cool numbers in the version of my dll's too, not version 1.0.0.0, which let's face it is a bit dull.

I tried a few things, but it doesn't seem to be out-of-box functionality, or maybe I'm just looking in the wrong place (as usual).

I work with mainly web projects....

I looked at both:

and I couldn't believe it so much effort to do something is standard practice.

EDIT:It does not work in VS2005 as far I can tell (http://www.codeproject.com/KB/dotnet/AutoIncrementVersion.aspx)

pb2q
48.7k15 gold badges122 silver badges131 bronze badges
inspiteinspite
15.6k21 gold badges69 silver badges88 bronze badges
Visual studio 2013 c++ version number

24 Answers

In visual Studio 2008, the following works.

Find the AssemblyInfo.cs file and find these 2 lines:

You could try changing this to:

But this won't give you the desired result, you will end up with a Product Version of 1.0.* and a File Version of 1.0.0.0. Not what you want!

However, if you remove the second of these lines and just have:

Then the compiler will set the File Version to be equal to the Product Version and you will get your desired result of an automatically increment product and file version which are in sync. E.g. 1.0.3266.92689

Sam MeldrumSam Meldrum
12.4k6 gold badges29 silver badges38 bronze badges

open up the AssemblyInfo.cs file and change

to

you can do this in IDE by going to project -> properties -> assembly information

This however will only allow you to auto increment the Assembly version and will give you the

Assembly File Version: A wildcard ('*') is not allowed in this field

message box if you try place a * in the file version field.

So just open up the assemblyinfo.cs and do it manually.

abatishchev
72.4k70 gold badges270 silver badges406 bronze badges
HathHath
10k7 gold badges29 silver badges36 bronze badges

Another option for changing version numbers in each build is to use the Version task of MSBuild.Community.Tasks. Just download their installer, install it, then adapt the following code and paste it after <Import Project='$(MSBuildBinPath)Microsoft.CSharp.targets' /> in your .csproj file:

Note: Adapt the StartDate property to your locale. It currently does not use the invariant culture.

For the third build on January 14th, 2010, this creates a VersionInfo.cs with this content:

This file then has to be added to the project (via Add existing item), and the AssemblyVersion and AssemblyFileVersion lines have to be removed from AssemblyInfo.cs.

The different algorithms for changing the version components are described in $(MSBuildExtensionsPath)MSBuildCommunityTasksMSBuild.Community.Tasks.chm and Version Properties.

ChristianChristian
6,9945 gold badges39 silver badges49 bronze badges

I came up with a solution similar to Christians but without depending on the Community MSBuild tasks, this is not an option for me as I do not want to install these tasks for all of our developers.

I am generating code and compiling to an Assembly and want to auto-increment version numbers. However, I can not use the VS 6.0.* AssemblyVersion trick as it auto-increments build numbers each day and breaks compatibility with Assemblies that use an older build number. Instead, I want to have a hard-coded AssemblyVersion but an auto-incrementing AssemblyFileVersion. I've accomplished this by specifying AssemblyVersion in the AssemblyInfo.cs and generating a VersionInfo.cs in MSBuild like this,

This will generate a VersionInfo.cs file with an Assembly attribute for AssemblyFileVersion where the version follows the schema of YY.MM.DD.TTTT with the build date. You must include this file in your project and build with it.

Tohid
3,5684 gold badges29 silver badges67 bronze badges
BoogBoog
1,8884 gold badges19 silver badges23 bronze badges

Install the Build Version Increment add-in. It gives you way more control than the * option.

Ryan Gates
3,6704 gold badges41 silver badges76 bronze badges
null

To get the version numbers try

To set the version number, create/edit AssemblyInfo.cs

Also as a side note, the third number is the number of days since 2/1/2000 and the fourth number is half of the amount of total seconds in the day. So if you compile at midnight it should be zero.

Developer
18.6k61 gold badges241 silver badges411 bronze badges
BobBob
71.4k27 gold badges109 silver badges122 bronze badges

There is a visual studio extension Automatic Versions which supports Visual Studio 2012, 2013, 2015 & 2017.

Screen Shots

RahulRahul

Setting a * in the version number in AssemblyInfo or under project properties as described in the other posts does not work with all versions of Visual Studio / .NET.

Afaik it did not work in VS 2005 (but in VS 2003 and VS 2008). For VS 2005 you could use the following: Auto Increment Visual Studio 2005 version build and revision number on compile time.

But be aware that changing the version number automatically is not recommended for strong-named assemblies. The reason is that all references to such an assembly must be updated each time the referenced assembly is rebuilt due to the fact that strong-named assembly references are always a reference to a specific assembly version. Microsoft themselves change the version number of the .NET Framework assemblies only if there are changes in interfaces. (NB: I'm still searching for the link in MSDN where I read that.)

Dirk VollmarDirk Vollmar
144k49 gold badges234 silver badges291 bronze badges

To get incrementing (DateTime) information into the AssemblyFileVersion property which has the advantage of not breaking any dependencies.

Building on Boog's solution (did not work for me, maybe because of VS2008?), you can use a combination of a pre-build event generating a file, adding that file (including its version properties) and then using a way to read out those values again. That is..

Pre-Build-Event:

Include the resulting VersionInfo.cs file (Properties subfolder) into your project

Code to get Date back (years down to seconds):

Not very comfortable.. also, I do not know if it creates a lot of force-rebuilds (since a file always changes).

You could make it smarter for example if you only update the VersionInfo.cs file every few minutes/hours (by using a temporary file and then copying/overwriting the real VersionInfo.cs if a change large enough is detected). I did this once pretty successfully.

Andreas ReiffAndreas Reiff
3,9546 gold badges33 silver badges74 bronze badges

Set the version number to '1.0.*' and it will automatically fill in the last two number with the date (in days from some point) and the time (half the seconds from midnight)

James CurranJames Curran
88.2k31 gold badges162 silver badges245 bronze badges

It is in your project properties under Publish


(~ http://screencast.com/t/Vj7rhqJO)

Community
AlexAlex
10.3k3 gold badges26 silver badges45 bronze badges

Cake supports AssemblyInfo files patching. With cake in hands you have infinite ways to implement automatic version incrementing.

Simple example of incrementing version like C# compiler does:

Here:

  • Version - is assembly version. Best practice is to lock major version number and leave remaining with zeroes (like '1.0.0.0').
  • FileVersion - is assembly file version.

Note that you can patch not only versions but also all other necessary information.

halhal
9091 gold badge13 silver badges20 bronze badges

Go to Project | Properties and then Assembly Information and then Assembly Version and put an * in the last or the second-to-last box (you can't auto-increment the Major or Minor components).

MusiGenesisMusiGenesis
62.3k35 gold badges172 silver badges313 bronze badges

Use the AssemblyInfo task from the MSBuild Community Tasks (http://msbuildtasks.tigris.org/) project, and integrate it into your .csproj/.vbproj file.

It has a number of options, including one to tie the version number to the date and time of day.

Recommended.

devstuffdevstuff
7,8491 gold badge22 silver badges30 bronze badges

As of right now, for my application,

returns ver = 1.0.3251.27860

The value 3251 is the number of days since 1/1/2000. I use it to put a version creation date on the splash screen of my application. When dealing with a user, I can ask the creation date which is easier to communicate than some long number.

(I'm a one-man dept supporting a small company. This approach may not work for you.)

Deanna
21.2k6 gold badges55 silver badges128 bronze badges
SeaDriveSeaDrive
2,2744 gold badges27 silver badges28 bronze badges

Changing the AssemblyInfo works in VS2012. It seems strange that there's not more support for this in Visual Studio, you'd think this was a basic part of the build/release process.

MaxcelcatMaxcelcat

This one is kind of experimental, but I like it. Inspired by Jeff Atwood @ CodingHorror (link).

The resulting version number becomes 1.2016.10709.11641 (meaning 2016-07-09 16:41), which allows for

  • poor mans zero padding (with the stupid leading 1s)
  • nearly-human readable local DateTime embedded into the version number
  • leaving Major version alone for really major breaking changes.

Add a new item to your project, select General -> Text Template, name it something like CustomVersionNumber and (where applicable) comment out the AssemblyVersion and AssemblyFileVersion in Properties/AssemblyInfo.cs.

Then, when saving this file, or building the project, this will regenerate a .cs file located as a sub-item under the created .tt file.

user3638471

Maybe, for this task, you can use code like this:

and call it from form loading.
With this code you can update any part of file info in AssemblyInfo.cs (but you must use 'standard' directory structure).

AtirisAtiris
SergiySergiy
9492 gold badges10 silver badges19 bronze badges

I'm using this approach https://stackoverflow.com/a/827209/3975786 by placing the T4 template in a 'Solution Items' and using it with 'Add as Link' within each project.

Community
mcandalmcandal

I have created an application to increment the file version automatically.

  1. Download Application
  2. add the following line to pre-build event command line

    C:tempIncrementFileVersion.exe $(SolutionDir)PropertiesAssemblyInfo.cs

  3. Build the project

To keep it simple the app only throws messages if there is an error, to confirm it worked fine you will need to check the file version in 'Assembly Information'

Note : You will have to reload the solution in Visual studio for 'Assembly Information' button to populate the fields, however your output file will have the updated version.

For suggestions and requests please email me at telson_alva@yahoo.com

Telson AlvaTelson Alva
4834 gold badges18 silver badges33 bronze badges

Maybe it's too late to answer here but hope that will solve someone's hectic problem.

An automatic way to change assembly version of all of your projects using PowerShell script. This article will solve many of your problems.

Khawaja AsimKhawaja Asim

Each time I do a build it auto-increments the least-significant digit.

I don't have any idea how to update the others, but you should at least be seeing that already...

Brian KnoblauchBrian Knoblauch
15.3k12 gold badges47 silver badges79 bronze badges

It was not enough for me adding

When building it throws me this error

The specified version string does not conform to the required format

Visual Studio 2010 Version Numbers

Solution

The format was finally accepted after I set Deterministic to False in project.csproj

For some reason setting Deterministic to False messed up my config file loading it and saving it on different locations.

Workaround:

Visual Studio 2013 Update 4 Version Number

I setup a post-build event to increment the revision number:

Post-Build Event batch script

This calls a powershell script named autoincrement_version.ps1 passing as argument the path of AssemblyInfo.cs

Poweshell script

It autoincrements the revision number using Regex

Visual Studio 2013 Version Number

MadacolMadacol

Not the answer you're looking for? Browse other questions tagged c#asp.netvisual-studioversion-controlassemblyinfo or ask your own question.