I'm developing a REST Api using ASP.NET Core. I used to shared assembly info across my solution using a shared file containing common attributes such as AssemblyCompany, AssemblyCopyright, AssemblyTrademark and AssemblyVersion. In this way all of my projects in a solution would be compiled with the same Assembly info attributes.
In ASP.NET Core these attributes are now defined in the project.json file. Is there a way to share these attributes in a similar way?
With the exception of AssemblyVersion, the assembly attributes you mentioned can still be defined in a shared file. This file can be added to the project under "buildOptions".
Example:
See https://learn.microsoft.com/en-us/dotnet/articles/core/tools/project-json#buildoptions for more details.
AssemblyVersion can't be shared because it is always generated from the
"version"
value in project.json."version"
defaults to 1.0.0 if not specified.Other attributes, such as AssemblyCopyright, will not be generated if their corresponding field is left empty in project.json.