How to change assembly info in asp.net core?

拥有回忆 提交于 2019-12-07 03:09:58

问题


I want to versioning my asp.net core app.

I followed this link: http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/ , but I want to remove project assembly info, but I didn't find it.

How to remove duplicated assembly info? I want to override asp core assemblies with another file.



BETTER SOLUTION

After a while I realize that the best solution is to use a T4 file, the version is incremented automatically after each build.

look here:

http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/


回答1:


Right now properties could be defined in .csproj or using AssemblyInfo.cs, but only the one place could be used, otherwise "Duplicate" errors are generated.


If you want to use AssemblyInfo.cs, add the following into .csproj to avoid duplication errors:

<PropertyGroup>
  <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

If you are interesting how does it work, look into GenerateAssemblyInfo task.


Otherwise, remove AssemblyInfo.cs and add the following property into your .csproj file:

<PropertyGroup>
  <AssemblyVersion>1.2.3.4</AssemblyVersion>
</PropertyGroup>


来源:https://stackoverflow.com/questions/46727007/how-to-change-assembly-info-in-asp-net-core

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