How to Manually Change Assembly Version Number of an Existing EXE Program?

Posted on 2011-04-26
Last Modified: 2012-06-27
I would like to know if there is a way for me to manually change the Assembly Version Number of an EXE program.  I want Visual Studio to automatically change the Assembly Version Number for me whenever I rebuild the EXE program.  But in some occasions, I need the EXE program to have a specific version number.  This means I want to be able to change the Assembly Version Number of the EXE file.  But the Assembly Version number field of the file properties is read-only.  Is there a way to change it?

Question by:homerslmpson
    LVL 19

    Accepted Solution

    In the Properties folder there is a file called AssemblyInfo.cs.  You can set the version in the following lines:
    [assembly: AssemblyVersion( "" )]
    [assembly: AssemblyFileVersion( "" )]
    LVL 33

    Expert Comment

    by:Todd Gerbert
    Or right-click your project, choose properties, then click the "Assembly Information" button on the "Application" tab.  Specifying version numbers here is identical to doing it manually as Dan7el already suggested; if you use a "*" in one of the two right-most positions of the Assembly Version then Visual Studio will automatically increment it for you (if you use a "*" in the second-to-last position, then last one must be empty).
    LVL 1

    Author Closing Comment

    Thanks for the confirmation.

    Actually I already know that I can assign a version number to a _new_ EXE file by changing the Assembly Version property in the AssemblyInfo.cs program file.  I was just hoping that I didn't need to mess with the AssemblyInfo.cs file and could go directly to change the version number in an _existing_ EXE file.  If this cannot be done, I will accept this and move on instead of procastinating.  Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now