Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute
See original GitHub issueSteps 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:
- Created 7 years ago
- Reactions:5
- Comments:55 (22 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my case I need to remove bin and obj folders after any change, do restore and then build. This fixed issue.
I think the name might have changed?
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
does seem to work.