locked
Compile Error CS0579: Duplicate 'AssemblyVersion' attribute RRS feed

  • Question

  • I have created a new GAT project. Removed all the existing projects which are shown by default in the Project.

    I am adding a new project under Templates/Solutions/Projects/MyClassProject

     

    This folder has a file Properties/AssemblyInfo.cs. When am compiling my solution I ma getting the following compile errors

     

    Can someone help me understand why is this compiler errors seen? This AssemblyInfo.cs if my GAT project's file and it seems to be clashing with Templates/Solutions/Projects/MyClassProject/Properties/AssemblyInfo.cs file.

     

    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(31,12): error CS0579: Duplicate 'AssemblyVersion' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(20,12): error CS0579: Duplicate 'ComVisible' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(15,12): error CS0579: Duplicate 'AssemblyCulture' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(14,12): error CS0579: Duplicate 'AssemblyTrademark' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(13,12): error CS0579: Duplicate 'AssemblyCopyright' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(12,12): error CS0579: Duplicate 'AssemblyProduct' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(11,12): error CS0579: Duplicate 'AssemblyCompany' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(10,12): error CS0579: Duplicate 'AssemblyConfiguration' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(9,12): error CS0579: Duplicate 'AssemblyDescription' attribute
    C:\TempForDelete\Rnd\Test_GuidancePackage\MyApplicationPackage\MyApplicationPackage\Properties\AssemblyInfo.cs(8,12): error CS0579: Duplicate 'AssemblyTitle' attribute

    Sunday, March 2, 2008 9:50 AM

Answers


  • This is because you haven't marked the .cs files you added as content files. You need to make sure the .cs files you add to the "Templates" folder are properly marked as "Build Action=Content" and "Copy To Output Directory=Copy If Newer" so they don't get compiled with your solution (and classes don't clash).

    In GAT, there is a recipe for automating this setting, if you right-click on the "Templates" folder you should see it, I just don't remember the exact name for it right now, sorry.

    -vga.
    Monday, March 3, 2008 4:00 AM
  • When you right click on the "Templates" folder of your guidance package project you should get a menu option named "Set Content Files Build Properties", this is the recipe that will automatically set proper build properties for all the content files within that folder. If this option doesn't appear please make sure that GAT is enabled for the solution you're working on (go to Tools->Guidance Package Manager->Enable/Disable Packages and make sure Guidance Package Development is checked).

    If you want to do this manually, you need to go to each file located within "Templates" folder, look at its properties (press F4) and set its "Build Action" property to "Content" and its "Copy To Output Directoy" as "Copy if newer".

    HTH,
    -vga.
    Tuesday, March 4, 2008 3:11 AM

All replies


  • This is because you haven't marked the .cs files you added as content files. You need to make sure the .cs files you add to the "Templates" folder are properly marked as "Build Action=Content" and "Copy To Output Directory=Copy If Newer" so they don't get compiled with your solution (and classes don't clash).

    In GAT, there is a recipe for automating this setting, if you right-click on the "Templates" folder you should see it, I just don't remember the exact name for it right now, sorry.

    -vga.
    Monday, March 3, 2008 4:00 AM
  • Thanks Vga.

     

    I am unable to see that property (recipie) used for automating this settings.

    Can you please help me understand where and how do I set it manually?

    Monday, March 3, 2008 4:32 AM
  • When you right click on the "Templates" folder of your guidance package project you should get a menu option named "Set Content Files Build Properties", this is the recipe that will automatically set proper build properties for all the content files within that folder. If this option doesn't appear please make sure that GAT is enabled for the solution you're working on (go to Tools->Guidance Package Manager->Enable/Disable Packages and make sure Guidance Package Development is checked).

    If you want to do this manually, you need to go to each file located within "Templates" folder, look at its properties (press F4) and set its "Build Action" property to "Content" and its "Copy To Output Directoy" as "Copy if newer".

    HTH,
    -vga.
    Tuesday, March 4, 2008 3:11 AM
  •  

    Thanks vga. I got the solution. It works now.
    Tuesday, March 4, 2008 4:15 AM

  • No problem, glad I could help!
    Thursday, March 6, 2008 3:05 AM
  • Everyone who posted.   That depends though.  For a Web Site Project they should be marked at Content but for a WAP project (Web Application Project) they should be marked as "Compile"
    C# Web Developer
    Friday, August 7, 2009 8:08 PM