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.

New tooling leaves a mess under obj, causing duplicate attribute problems

See original GitHub issue

The current dotnet build tooling seems to leave files such as obj/{configuration}/{platform}/dotnet-compile.assemblyinfo.cs. This can break some existing builds, for example in dapper we use out-of-project file references:

  "compile": [
    "../Dapper/**/*.cs"
  ],

This worked fine previously, but now creates things like:

error CS0579: Duplicate 'System.Reflection.AssemblyInformationalVersionAttribute' attribute

(because of course it finds the file for each platform and/or configuration)

We can fix this by adding:

   "compileExclude": [
    "../Dapper/obj/"
  ],

But; this seems pretty horrible. I’m not saying the setup is perfect here, but it seems like maybe the tooling should default to ignoring files that it almost certainly created (for a different purpose, and unless it knows that it really wants it for what it is currently doing). Or alternatively: don’t leave such things behind ;p

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
NickCravercommented, Jul 19, 2016

This is still a problem in RTM (Preview 2 tooling).

0reactions
NickCravercommented, May 19, 2016

This is still a problem in RC2.

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 >
CS0579 Duplicate Attribute Error with .NET Core
The error is a result of the build process generating AssemblyInfo. cs files in each project obj directory. This file exists to provide...
Read more >
Ten Common Database Design Mistakes - Simple Talk
If database design is done right, then the development, deployment and subsequent performance in production will give little trouble.
Read more >
Refactoring: This class is too large - Martin Fowler
This article is about tackling the first problem in the above list: ... code contains the most duplication, and is causing the most...
Read more >
Repair Geometry (Data Management) - ArcGIS Pro Resources
ArcGIS geoprocessing tool that inspects features for geometry problems and repairs them.
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