Answer based on the comment from @jo0ls.
Close down Visual Studio and open the project file (*.csproj or *.vbproj) in a text editor. Search for "Deterministic" which is enabled by default from .NET 4.7.2. Set to "false" or delete the entry in the project file to allow wildcards in the AssemblyVersion
attribute.
For some background on the Deterministic
compile option see this link. The option ensures repeated builds produce byte-for-byte identical binaries (i.e. version information must not change, hence no wildcards allowed).
Another reason for this error is specific to VB.NET. AssemblyInfo.vb
must be in a folder named exactly "My Folder". Say you rename the folder to "MyFolder" and manually update the .vbproj file to point to the renamed folder. The project builds, but only default version information will be included in the assembly. Data in AssemblyInfo.vb is ignored and wildcards in the AssemblyVersion
attribute generate compiler error BC36962 "The specified version string does not conform to the required format".