I am just trying to understand the whole build/publish topic for .NET Core and was playing around with one basic console application.
When I build the app
dotnet build
and afterwards build it with release configuration
dotnet build --configuration Release
I receive errors saying
Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute [test]
obviously the files
./obj/Debug/netcoreapp2.1/test.Assembly.info
and
./obj/Release/netcoreapp2.1/test.Assembly.info
store values for the same attributes:
What am I doing wrong?
Some further questions to get a clearer picture of this:
I've read all the documentation from ms but imo its from and for people more familiar with building processes.
Thank you very much in advance
In short, setting GenerateAssemblyInfo to false in the relevant .csproj should do the trick:
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
See this git-issue
And this one
Short explanation: .NET CORE first introduced the project.json based project system, which replaced AssemblyInfo.cs. Later, project.json was dropped in favor of a more extensive .csproj usage. Read more here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With