Getting a compile time error CS0579: Duplicate 'AssemblyFileVersionAttribute' attribute

attributes, c#, duplicates

Solution

I think you already specified those attributes in Assembly Information window of Project Properties. If you did this, remove those attributes from the Assembly Information.

Problem

I recently added some copyright information to a set of C# projects (dlls) via the Properties->Application->Assembly Information button. I have several such projects in a single solution. Upon compilation I get error message of the type: error CS0579: Duplicate 'XXX' attribute where 'XXX' is the name of one of the attributes I specified (e.g. AssemblyFileVersionAttribute) Googling I found that in the case of a class that is derived from the Attribute class, duplicates can be permitted by use of: ``` [System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=true)] class NewAttribute : System.Attribute { } ``` But in my case, I have added these attributes via the properties dialog and have statements (in AssemblyInfo.cs for each project) such as: ``` [assembly: AssemblyCompanyAttribute("My Company")] [assembly: AssemblyProductAttribute("My Product")] [assembly: AssemblyCopyrightAttribute("© 2012 My Company, All Rights Reserved.")] [assembly: AssemblyVersionAttribute("13.0.0.0")] [assembly: AssemblyFileVersionAttribute("1.0.0.0")] ``` and do not have any manually derived attribute classes I can attach any qualifiers to. How do I solve this duplicate issue?

Original source