question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet build3 complains about duplicate TF attributes.

See original GitHub issue

Steps to reproduce

Install from https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/latest.version dotnet new -t msbuild dotnet restore dotnet build3

Expected behavior

Successful build

Actual behavior

C:\Users\srivatsn\AppData\Local\Temp.NETCoreApp,Version=v1.0.AssemblyAttributes.cs(4,12): error CS0579: Duplicate ‘global::System.Runtime.Versioning.TargetFrameworkAttribute’ attribute [C:\Users\srivatsn\Downloads\dotnet-dev-win-x64.latest\test\test.csproj]

Looks like the TFAttribute is both in the generated assemblyinfo.cs in obj and the file mentioned in the error.

Environment data

dotnet --info output:

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
srivatsncommented, Sep 1, 2016

Yes removing the obj directory made the error go away.

0reactions
brthorcommented, Sep 1, 2016

@rainersigwald Agreed, I can’t repro this without having first run an ordinary dotnet build which generates under obj (even running build3 multiple times doesn’t break)

I don’t think anything is wrong with @nguerrera 's assembly info generation.

Being that this issue is tracked in the linked msbuild issue, let’s close this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS 2017 Build Errors - Duplicate Attributes in AssemblyInfo ...
This happens because the new .NET tools automatically create the attributes and add them to the assembly, so they now appear twice in...
Read more >
Dealing with Duplicate Assembly Attributes in .Net Core
When migrating a project from .Net Framework to .Net Standard, you may run into issues where you get duplicate assembly attributes.
Read more >
OFFICIAL ZONING ORDINANCE I
ADXIXXSTRATIOiV' AND EITORCEME~~T OF ZONING THROUGHOUT. UNINCORPORATED LEE COUNTY; PROVIDING JUSTIPICATOXY. CLAUSES; PROVIDING FOR A TABLE OF CONTENTS; ...
Read more >
qandamaster423.xml
... 2018-10-28 monthly https://www.chegg.com/homework-help/questions-and-answers/using-microsoft-visual-studio-2017-c-write-c-program-calculate-analyze-data ...
Read more >
1768 Copy o
Constituent authorizes and empowers his said agent and attorney-in-fact for him and in his name to: Collect all money;;due, give receipts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found