Can I automatically increment the file build version when using Visual Studio?

后端 未结 25 2874
-上瘾入骨i
-上瘾入骨i 2020-11-22 14:32

I was just wondering how I could automatically increment the build (and version?) of my files using Visual Studio (2005).

If I look up the properties of sa

25条回答
  •  不要未来只要你来
    2020-11-22 15:32

    For anyone using Tortoise Subversion, you can tie one of your version numbers to the subversion Revision number of your source code. I find this very useful (Auditors really like this too!). You do this by calling the WCREV utility in your pre-build and generating your AssemblyInfo.cs from a template.

    If your template is called AssemblyInfo.wcrev and sits in the normal AssemblyInfo.cs directory, and tortoise is in the default installation directory, then your Pre-Build command looks like this (N.B. All on one line):

    "C:\Program Files\TortoiseSVN\bin\SubWCRev.exe" "$(ProjectDir)." "$(ProjectDir)Properties\AssemblyInfo.wcrev"  "$(ProjectDir)Properties\AssemblyInfo.cs"
    

    The template file would include the wcrev token substitution string: $WCREV$
    e.g.

    [assembly: AssemblyFileVersion("1.0.0.$WCREV$")]
    

    Note:
    As your AssemblyInfo.cs is now generated you do not want it version controled.

提交回复
热议问题