In previos version of .net on AssemblyInfo.cs if we change
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
to
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
and compile our project build version compiler sets automatically build version to dll or.. files.
in .net core we have this
{
"version": "1.0.0",
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
},
how can we do it on .net core on UI tier?
You can go into the Project properties under Application Tab and set the assembly information usig the available "Assembly Information" button. This allows the Title/description/Copyright notice/Assembly version and neutral language to be set. But ultimately it just sets the values into the Project.json file
"title": "project name",
"copyright": "company copyright",
"description": "project description",
"version": "1.0.0-*",
来源:https://stackoverflow.com/questions/38946808/how-to-set-build-version-automatically-in-net-core-projects