Error CS0579 Duplicate System.Reflection.AssemblyVersionAttribute attribute

Introduction :

Error CS0579 Duplicate System.Reflection.AssemblyVersionAttribute attribute during, When adding multiple project in same solution explorer in visual studio we are getting an error, Error CS0579 Duplicate ‘global::System.Runtime.Versioning.TargetFrameworkAttribute’ attribute

Also Read .Net Core: Read Connection String from AppSettings.json file

Error :

 Error CS0579 Duplicate ‘System.Reflection.AssemblyVersionAttribute’ attribute

Error CS0579 Duplicate ‘System.Reflection.AssemblyTitleAttribute’ attribute

Error CS0579 Duplicate ‘System.Reflection.AssemblyProductAttribute’ attribute

Error CS0579 Duplicate ‘System.Reflection.AssemblyInformationalVersionAttribute’ attribute

Error CS0579 Duplicate ‘System.Reflection.AssemblyFileVersionAttribute’ attribute

Error CS0579 Duplicate ‘System.Reflection.AssemblyConfigurationAttribute’ attribute

Error CS0579 Duplicate ‘System.Reflection.AssemblyCompanyAttribute’ attribute

Error CS0579 Duplicate ‘global::System.Runtime.Versioning.TargetFrameworkAttribute’ attribute

 


Error CS0579 Duplicate System.Reflection.AssemblyVersionAttribute attribute

Resolution:

I have 2 projects in a solution, and I am not sure why I am running into this error, when i building 1st project getting above error.

adding the following two line  to <PropertyGroup> error are resolved

<Project Sdk=”Microsoft.NET.Sdk.Web“>

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

</Project>

once you have build project error will be resolved.

Leave a Reply

Your email address will not be published.