Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share assembly info in ASP.NET Core?

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?

like image 611
Janni Kajbrink Avatar asked Jan 03 '17 09:01

Janni Kajbrink


1 Answers

In case others get by here and are looking for a solution that works with .Net Core > 2.1 and the new .csproj project files:

After some research I got it working using Directory.Build.props file in a parent directory. You can find the sample code and some more information in this repository.

like image 112
Marc Avatar answered Nov 06 '22 13:11

Marc