After upgrading to a csproj to use Visual Studio 2017 and Microsoft.NET.Sdk, my \"BeforeBuild\" and \"AfterBuild\" targets are no longer running. My file looks like this:
In the already mentioned GitHub issue Rainer Sigwald provides much shorter and elegant solution:
... ...
Looks odd, but works fine.