SharedAssemblyInfo equivalent in .net core projects?

You can add a Directory.Build.props file above all the .csproj files that you want to default properties for. This .props file will automatically be imported in all the .csproj files below it. You can set common properties in it:

<Project>
  <PropertyGroup>
    <Company>Erhardt Enterprises</Company>
    <Copyright>Erhardt Enterprises ©</Copyright>
  </PropertyGroup>
</Project>

And these MSBuild properties will apply to all the .csproj files under it. So when the assembly attributes are generated, these values will be used across all projects.

Here is the mapping of all MSBuild properties to assembly attributes.


You can create .props file (for example common.props) and put common project configuration in this file:

common.props:

<Project>
  <PropertyGroup>
    <AspNetCoreVersion>2.0.0</AspNetCoreVersion>
  </PropertyGroup>
</Project>

project1.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <Import Project=".\common.props" />

  ...

</Project>

project2.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <Import Project=".\common.props" />

  ...

</Project>

You can find more info on this link