Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Compile Error CS0579: Duplicate 'AssemblyVersion' attribute
 

Compile Error CS0579: Duplicate 'AssemblyVersion' attribute

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

radenb  Sunday, March 02, 2008 9:50 AM

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.
vga  Monday, March 03, 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.
vga  Tuesday, March 04, 2008 3:11 AM

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.
vga  Monday, March 03, 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?

radenb  Monday, March 03, 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.
vga  Tuesday, March 04, 2008 3:11 AM

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

No problem, glad I could help!
vga  Thursday, March 06, 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
NoEgo  Friday, August 07, 2009 8:08 PM

You can use google to search for other answers

Custom Search

More Threads

• Error unfolding a project template
• Can not install Web Client Software Factory Templates
• Guidance Package Visual Studio 2005 Project Template not installed on Win XP Service Pack 2
• Any Examples of Custom Wizard Panels?
• classname value
• GAX/GAT Custom Menu won't update after second Build/Registration
• Unable to add reference to project
• Guidance Package Manager not visible in VS2008SP1 - captured a dump with the troubleshooting utility - please advise
• Issues with VS Team System 2008 Dev Edition
• Creating a Recipe for updating a config file