Skip to content

mduu/dotnetcore_shared_assemblyinfo

Repository files navigation

Test for .Net Core projects sharing assembly infos

Some of you may know the good old shared assembly infos for .Net Full-Framework solutions where you store your common assembly-info entries (version, copyright, etc.) in a shared file which you then link into all your assemblies to get them compiled into the binaries.

As we are in the process of moving on to .Net Core (or at least support it side-by-side with the Full-Framework) I did some research and testing how this can be achieved in the new .Net world.

In short: yes, it can be done but with the .Net Core versions also this system changed already.

This repo demonstrates how to do it with .Net Core 2.1 and the new/current XML-based .csproj projects powered by MSBuild 15 and Visual Studio 2017.

Key points

  1. Create a file called Directory.Build.props somewhere up in the folder hierarchy of your projects. For example in the repo root.
  2. Fill this file your shared properties. See mine...
  3. Remove the shared properties from your .csproj files. Otherwise you get ugly error messages from VisualStudio and MSBuild reporting a "Error for importing ...".
  4. Build your solution and check the binaries. Happy.

Links with more information:

About

Demonstrate the usage of shared assembly infos with .Net Core, VS2017, MSBuild 15

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages