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.

Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute

See original GitHub issue

Steps to reproduce

I am using 1.0.0-preview4-004079 prerelase version of .Net core. My csproj file is following:

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
  
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="**\*.cs" />
    <EmbeddedResource Include="**\*.resx" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NETCore.App">
      <Version>1.0.1</Version>
    </PackageReference>
    <PackageReference Include="Microsoft.NET.Sdk">
      <Version>1.0.0-alpha-20161104-2</Version>
      <PrivateAssets>All</PrivateAssets>
    </PackageReference>
	<PackageReference Include="System.Collections.Specialized">
	<Version>4.0.1</Version>
	</PackageReference>
  </ItemGroup> 
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


After dotnet restore I don’t get any error or warning, but after dotnet build I am getting 9 errors like error CS0579: Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute .

Is this because of incorrect version of System.Collections.Specialized and how to fix this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:55 (22 by maintainers)

github_iconTop GitHub Comments

49reactions
SamvelScommented, Nov 14, 2016

In my case I need to remove bin and obj folders after any change, do restore and then build. This fixed issue.

46reactions
rkeithhillcommented, Jul 13, 2017

I think the name might have changed? <GenerateAssemblyInfo>false</GenerateAssemblyInfo> does seem to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Duplicate AssemblyVersion Attribute
Reflection.AssemblyCompanyAttribute' attribute" describes 3 options : remove the conflicting items from the AssemblyInfo.cs file,; completely ...
Read more >
Duplicate 'System.Reflection.AssemblyCompanyAttribute' ...
Steps to reproduce I am using 1.0.0-preview4-004079 prerelase version of .Net core. My csproj file is following:
Read more >
Duplicate 'System.Reflection.AssemblyCompanyAttribute' ...
Searching the project each of these attributes only exists only in the AssemblyInfo.cs file found under properties.
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 MSBuild ......
Read more >
C# - Duplicate 'AssemblyVersion' attribute
Visual Studio auto-generates an assembly version file, which is why you get this duplicate attribute error.
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