Yes, you can get an automatic version increase by using * in the [AssemblyVersion] attribute. Unfortunately, this is rarely the case. What Microsoft was supposed to do was provide the ability to [AssemblyFileVersion]. They did not do this.
[AssemblyVersion] is a very important attribute used by the CLR to verify that the assembled assembly is compatible with the assembly used to compile the code. “Compatible” means: the assembly will work purely with client code, no changes were made to the source code of the assembly, which could make it work incorrectly if the client was not recompiled. Using this definition, updating bug fixes is very compatible. An update that reorganizes the internal implementation of classes in an assembly can also be very compatible. Changes to public classes or members are probably not compatible. Although the JIT compiler is very well versed in the fact that the changes were grossly incompatible (for example, removing a previously public member).
Using * in an attribute essentially means: it is always incompatible. Even if you have not changed the code at all, the assembly will be incompatible after it is built. This is pretty useless in most scenarios, unless you always build the assembly with your client code. And relocate them together. This works, but then the concept of having a version number generally becomes useless.
In short: IMO, you must manage the build version yourself. Change it when you break a change in the public interface of the assembly. This is definitely the approach Microsoft is taking. .NET 2.0 assemblies are still marked as version 2.0.0.0 in the .NET 3.5 SP1 environment. Even if they are no longer compatible, WaitHandle.WaitOne (int) is added later. Otherwise, they did a stellar job of maintaining compatibility over the past 5 years, which would not be easy.
Note that this does not apply to [AssemblyFileVersion], automatically increasing it for each assembly.
source share