How can I auto-increment an MVC 6 version number?

前端 未结 3 1217
故里飘歌
故里飘歌 2020-12-09 20:43

Previous versions of ASP.NET allowed you to auto-increment the version number via Project Properties. How can I do this in MVC 6?

3条回答
  •  长情又很酷
    2020-12-09 20:54

    ASP.NET 5 (DNX) Answer

    This is what the ASP.NET 5 team actually uses themselves. If you are using a continuous integration build server you can get your build server to set the DNX_BUILD_VERSION environment variable like so using PowerShell:

    $env:DNX_BUILD_VERSION=$version
    

    Your build machine then sets $version to 'build123' or something similar (It can't start with a number, has to be a character from the alphabet) Then, as long as your version number is set like so:

    {
        "version": "1.0.0-*"
    }
    

    The star will be replaced with the value in the DNX_BUILD_VERSION environment variable. See the ASP.NET 5 GitHub page here for more info.

提交回复
热议问题