How to set build version automatically in .net core projects?

一曲冷凌霜 提交于 2019-12-10 10:46:22

问题


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?


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!