Is it possible to get the number of times the application has been compiled to represent an accurate build number in C#? So the first time you compile and run the app it should say 1. Then on the second 2, and so on. I'm looking for something built in, I don't want to keep track in a file or anything.
I basically want this, but I want it to auto-increment each time it's compiled.
Assembly assembly = Assembly.GetExecutingAssembly();
int buildNumber = assembly.GetName().Version.Build;