【问题标题】:How to change assembly info in asp.net core?如何更改 asp.net 核心中的程序集信息?
【发布时间】:2018-03-25 10:02:24
【问题描述】:

我想对我的 asp.net 核心应用程序进行版本控制。

我点击了这个链接:http://www.matthiaseinig.de/2013/05/20/auto-generate-fileversion-for-all-projects-in-a-solution-with-t4/,但是我想删除项目程序集信息,但我没有找到。

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



更好的解决方案

一段时间后,我意识到最好的解决方案是使用 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】:

    目前可以在.csprojAssemblyInfo.cs 中定义属性,但只能使用一个位置,否则会生成“重复”错误。


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

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

    如果您对它的工作原理感兴趣,请查看GenerateAssemblyInfo task


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

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

    【讨论】:

      猜你喜欢
      • 2016-12-09
      • 1970-01-01
      • 2018-04-03
      • 1970-01-01
      • 1970-01-01
      • 2020-01-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多