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.
Facing "Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute
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
2 answers
Sort by: Most helpful
-
Michael Taylor 54,896 Reputation points
2024-02-27T17:37:16.9033333+00:00 -
Ajay KN 0 Reputation points
2024-10-10T23:24:32.13+00:00 I have created .net core mvc project in visual studio 2022 with framework 8 LTS and added xunit project to same as a subfolder like c:\mainproject and c:\mainproject\ testmainproject and started getting "Error CS0579 Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute" error everything auto generated, I removed entire solution then
I created .net core mvc project in visual studio 2022 with framework 8 LTS and added xunit project to diffent folder C:\MainProject and C:\TestMainProject now it's working properly