Coding⏱️ 2 min read📅 2026-06-03

How to Fix: Error CS0579 Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute'

Duplicate TargetFrameworkAttribute error in .NETCoreApp project. Remove duplicate attribute.

Quick Answer: Remove the duplicate attribute from your AssemblyAttributes.cs file.

When building your application, you may encounter the CS0579 error due to a duplicate attribute in your .NET Core project. This error occurs when the TargetFrameworkAttribute is applied multiple times during the build process.

💡 Why You Are Getting This Error

  • Causes of this error include:

🔧 Proven Troubleshooting Steps

Method 1: Remove Duplicate Attribute

  1. Step 1: Open your project file and navigate to the TargetFrameworkAttribute line.
  2. Step 2: Delete the duplicate attribute, leaving only one instance.

Method 2: Use a Different Attribute

  1. Step 1: Replace the TargetFrameworkAttribute with the FrameworkAttributes attribute.
  2. Step 2: Ensure that you are using the correct version of the FrameworkAttributes attribute for your .NET Core project.

💡 Conclusion

By following these steps, you can successfully resolve the CS0579 error and continue building your application without any issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions