'Auto-increment version revision number with wildcard

I'm trying to raise the revision number with each build.

I've therefore tried to the project assembly information -> Assembly Version and File Version to

1 0 0 *
1 0 0 *

enter image description here

However, VS2017 tells me

"Assembly file version: In this field, wildcards ("*") aren't allowed.

How can I do this?



Solution 1:[1]

You should remove the AssemblyFileVersion attribute and just keep the AssemblyVersion. If AssemblyFileVersion is not present in the Assembly Information, the file version will automatically be set to the same as the AssemblyVersion at compile time.

Quoting the documentation:

If the AssemblyFileVersionAttribute is not supplied, the AssemblyVersionAttribute is used for the Win32 file versionthat is displayed on the Version tab of the Windows file properties dialog.

Solution 2:[2]

I know this is a very old question, however it appears when googling "auto increment version visual studio". Since the current answer doesn't really answer the question, this is what I did:

Assembly Version looks like 1 1 1 *

File Version like 1 1 1 0.

You cannot use wildcards (*) on the file version. If you use them on Assembly leave empty spaces after the wildcard (1 1 * EMPTY).

That works and the error

"Assembly file version: In this field, wildcards ("*") aren't allowed."

does not appear.

If that still gives you trouble, you could remove the "deterministic" flag editing the .csproj

Solution 3:[3]

Yet another option is: https://neele.name/item/versioning-controlled-build

This one works with Visual Studio 2017.

I found it to be easy to use and has the advantage that you can choose to invoke it or not depending on if you are creating a test build or a release build.

Solution 4:[4]

Ensure the Projects "Deterministic" property is set to false by editing the .vbproj file:

<PropertyGroup>
    <Deterministic>false</Deterministic>
</PropertyGroup>

Then open the AssemblyInfo.vb file and set the assembly version property like this: <Assembly: AssemblyVersion("1.0.*")>

Remove or comment-out the <Assembly: AssemblyFileVersion(...)> attribute since that cannot use wildcards, and if it isn't present, the file will inherit the version assembly number.

Setting the version number to 1.0.*, as in the above example, results in a version number similar to 1.0.8888.99999 where the build is equal to the number of days since January 1, 2000 local time, and the revision is equal to the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2.

See the Docs site for details.

Solution 5:[5]

Temporary solution - don't install latest version. Drop back to Miniconda3-py39_4.9.2-Linux-aarch64.sh (March 2021). Once installed do not update conda. As of this posting Miniconda3-py39_4.10.3-Linux-aarch64.sh (July 2021) doesn't work.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Hannah Vernon
Solution 3 David Shier
Solution 4 Hannah Vernon
Solution 5