如何更改asp.net core中的程序集信息?

2024-01-01

我想对我的 ASP.NET Core 应用程序进行版本控制。

我点击了这个链接:http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/ 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

BETTER SOLUTION

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

看这里:

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


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


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

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

如果您感兴趣它是如何工作的,请查看生成程序集信息任务 https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.GenerateAssemblyInfo.targets.


否则,删除AssemblyInfo.cs并将以下属性添加到您的.csproj file:

<PropertyGroup>
  <AssemblyVersion>1.2.3.4</AssemblyVersion>
</PropertyGroup>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何更改asp.net core中的程序集信息? 的相关文章

随机推荐