Setting file version number in Visual Studio 2005 C++
Asked Answered
M

4

14

Can anyone point me in the right direction how to configure Visual Studio 2005 with our C++ console project how we can include a 'File Version' in the details section of the file properties.

I've tried resource files without any luck. This is with a C++ project just for clarification, and big thank you for the guys you responded with C# suggestions.

Thanks in advance.

Medial answered 21/11, 2008 at 9:59 Comment(0)
F
34

If you are talking about unmanaged c++, you need to add a version resource to the project.

right-click on the project, choose add - Resource.... Choose Version and press new. There you can enter all info you need.

Flawed answered 21/11, 2008 at 10:20 Comment(2)
I do not see "version" resource at right-click on the project, choose add - Resource.Mazarin
@Mazarin does "How to: Create a Resource" help? Note that this answer does not apply to C++/CLI projects, and also not to windows store apps written in C++.Flawed
O
7

You have to have one VS_VERSION_INFO section in your resource (*.rc) file(s) that compile into your project.

In the Visual Studio 2005 Solution Explorer, open the context menu on your C++ project and choose Add, Resource.

Mark Version and click "New".

Fill in the fields as desired and save the file.

Build.

Now your project output has a FileInfo resource.

Please be aware that Windows Vista does not show all available version info in the Explorer context menu's "Details" tab.

Ostwald answered 21/11, 2008 at 10:38 Comment(0)
R
4

For c++ projects I use StampVer and call it as a post build operation including check in/out of revision control for release builds.

Rankins answered 21/11, 2008 at 10:37 Comment(0)
A
0

Unless you have a good reason for your file version to be different than the version of the assembly inside, I think it is a better idea to provide the AssemblyVersion alone. If you do not specify an AssemblyFileVersion, it will automatically get the same value, so you can see your assembly's version directly in the file's properties.

The advantage is that you can use a wildcard and allow the version to be automatically incremented, so that every time you compile the library you get a different build and/or revision number. As far as I can tell, this trick does not work with AssemblyFileVersion, so you have to increment it by hand.

Of course, all this only applies if you're writing .NET code. Are you by any chance talking about a project using unmanaged code?

Acroterion answered 21/11, 2008 at 10:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.