.NET Core App - How to get build number at runtime

后端 未结 3 1071
鱼传尺愫
鱼传尺愫 2021-01-12 14:39

I\'ve got a .NET Core MVC app which is built using TFS online, and published to Azure using the Release management stuff in TFS online. All very nice.

What I\'d lik

3条回答
  •  不要未来只要你来
    2021-01-12 15:22

    You need to save the Build Number in your application at compile time.

    You can access the build number with $Build.BuildNumber or $Env:BUILD_BUILDNUMBER depending on your environment. I usually write it as a variable into my ApplicationInfo.* with both the version and build number.

提交回复
热议问题