I am using Microsoft Visual C# 2010 Express. I have to change the version of my exe file. Please tell me how to do it, either by my C# code, or by batch file.
Asked
Active
Viewed 3.3k times
24
-
1change the AssemblyFileVersion in your AssemblyInfo.cs – Riv Jul 09 '13 at 13:15
-
1So you just want to update the version normally? It sounded like you were asking how to modify the version of an already-compiled exe. – Kyle Delaney Jan 29 '18 at 20:12
2 Answers
35
Somewhere in your code (favorably in AssemblyInfo.cs
in the Properties
folder of your project), put this:
[assembly: AssemblyVersion("1.0.0.0")]
Also possible is the file version attribute:
[assembly: AssemblyFileVersion("1.0.0.0")]
Make sure that you only have one instance of AssemblyVersion
and/or AssemblyFileVersion
attributes in a single assembly - everything else won't compile.

Basuro
- 1,084
- 9
- 12
-
@Reubz i meant to say that two instances of the same attribute won't compile – Basuro Jul 09 '13 at 13:18
-
16
You can change the Exe Version through an Assembly file. There are 2 options:
1st option is is to edit the assembly file:
[assembly: AssemblyTitle("TApplciation Name")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("5.8.3")]
[assembly: AssemblyFileVersion("5.8.3")]
2nd option is through project Property. Go To Project Property and click on the button which is circled:

Pete
- 1,305
- 1
- 12
- 36

Tanmay Nehete
- 2,138
- 4
- 31
- 42