Error error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute on Runtime.OpenSilver.csproj

47 views Asked by At

In some configurations the compiler can lead to multiple errors that look like:

error CS0579: Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute [path\OpenSilverFramework\src\Runtime\Runtime\Runtime.OpenSilver.csproj]

The duplicate attribute can be different depending on the system.

In the Runtime.OpenSilver.csproj I've added two more directive to make it play more nicely with mixed solution (.net and .net core):

<PropertyGroup> <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup>

That way the error disappear.

1

There are 1 answers

0
ugiacobbi On

As I mention by adding these two directives, I prevent visual studio to generate duplicate attributes.

<PropertyGroup> <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup>

That way the error disappears.