Facing "Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute

Dante Santos 0 Reputation points
2024-02-27T16:42:58.3133333+00:00

I have been facing the error below and have been following the main threads on Google. I've tried to delete the obj and bin folders and Rebuild the project, also updated Visual Studio, but I was not successful. Thanks for all of you that can help. Error:CS0579 Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute KilnDesktopApp C:\Users\xxx\Desktop\Kiln-Desktop-App\obj\Debug.NETFramework,Version=v4.7.2.AssemblyAttributes.cs

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,985 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,769 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
979 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 53,041 Reputation points
    2024-02-27T17:37:16.9033333+00:00

    Sounds like you have both an AssemblyInfo.cs file and possibly have enabled auto-generating the assemblyinfo file by the build. Please confirm you have not enabled the auto-generation of the assemblyinfo file, or alternatively ensure you don't have an AssemblyInfo.cs file as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.