如何在asp.net核心中更改汇编信息?

问题描述 投票:6回答:1

我想版本化我的asp.net核心应用程序。

我按照这个链接:http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/,但我想删除项目汇编信息,但我没有找到它。

如何删除重复的程序集信息?我想用另一个文件覆盖asp核心程序集。

enter image description here enter image description here enter image description here 更好的解决方案

过了一会儿,我意识到最好的解决方案是使用T4文件,每次构建后版本会自动递增。

看这里:

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

asp.net-core .net-core .net-assembly auto-versioning assembly-attributes
1个回答
14
投票

现在属性可以在.csproj中定义或使用AssemblyInfo.cs定义,但只能使用一个地方,否则会生成“重复”错误。


如果要使用AssemblyInfo.cs,请将以下内容添加到.csproj中以避免重复错误:

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

如果您感兴趣它是如何工作的,请查看GenerateAssemblyInfo task


否则,删除AssemblyInfo.cs并将以下属性添加到.csproj文件中:

<PropertyGroup>
  <AssemblyVersion>1.2.3.4</AssemblyVersion>
</PropertyGroup>
© www.soinside.com 2019 - 2024. All rights reserved.