Auto Versioning in Visual Studio 2017 (.NET Core)

后端 未结 16 1472
一整个雨季
一整个雨季 2020-11-28 18:45

I have spent the better part of a few hours trying to find a way to auto-increment versions in a .NETCoreApp 1.1 (Visual Studio 2017).

I know the the AssemblyInfo.cs

16条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 19:21

    If you're using Visual Studio Team Services/TFS or some other CI build process to have versioning built-in, you can utilize msbuild's Condition attribute, for example:

    
    
      
        0.0.1-local
        $(BUILD_BUILDNUMBER)
        netcoreapp1.1
      
    
      
        
      
      
        
        
        
      
    
    
    

    This will tell the .NET Core compiler to use whatever is in the BUILD_BUILDNUMBER environment variable if it's present, or fallback to 0.0.1-local if you're doing a build on your local machine.

提交回复
热议问题