Duplicate AssemblyVersion Attribute

前端 未结 21 1624
暖寄归人
暖寄归人 2020-12-02 11:07

I have a project that generates following error on compilation:

error CS0579: Duplicate \'AssemblyVersion\' attribute

I have che

21条回答
  •  时光说笑
    2020-12-02 11:24

    I came across the same when tried add GitVersion tool to update my version in AssemblyInfo.cs. Use VS2017 and .NET Core project. So I just mixed both worlds. My AssemblyInfo.cs contains only version info that was generated by GitVersion tool, my csproj contains remaingin things. Please note I don't use false I use attributes related to version only (see below). More details here AssemblyInfo properties.

    AssemblyInfo.cs

    [assembly: AssemblyVersion("0.2.1.0")]
    [assembly: AssemblyFileVersion("0.2.1.0")]
    [assembly: AssemblyInformationalVersion("0.2.1+13.Branch.master.Sha.119c35af0f529e92e0f75a5e6d8373912d457818")]
    

    my.csproj contains all related to other assemblyu attributes:

    
    ...
    SOME Company 
    Some Authors
    SOME Product
    ...
    false
    falsefalse
    

提交回复
热议问题