Menu

.Net Standard Duplicate Attribute error when using AssemblyInfo

19th May 2018 - c#, Development, dotnetcore

.Net Standard autogenerates the assembly info based on the project and solution. If you get this error when moving to .Net Standard, either delete the AssemblyInfo in the project, or update the proj file with the folowing;

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateFileVersionAttribute>false</GenerateFileVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
</PropertyGroup>

I hope this helps when you have errors building the projects when using .Net Standard and get CS0579 errors when building.

Tags: