I was successful to have this working locally:
<Target Name="InitializeSourceControlInformation" />
<UsingTask TaskName="GetAssemblyVersion" AssemblyFile="$(MSBuildSDKsPath)\Microsoft.NET.Sdk\tools\net46\Microsoft.NET.Build.Tasks.dll" />
<Import Project="$(MSBuildSDKsPath)\Microsoft.NET.Sdk\build\Microsoft.NET.GenerateAssemblyInfo.targets" />
But it fails on the CI server, which only has the VS 2017 BuiltTools. And in general it feels hacky and fragile.
But, I still want to use these targets because they are great. Is there a robust way to use them? They do not seem to depend on anything else in the Sdk realm, except one custom task.
EDIT 1
Our build servers indeed have VS 2017 Build Tools. But the developers all have VS 2017 and VS 2015. The latter is needed if a Silverlight bug has to be fixed. Yes, we still have Silverlight.
P.S.
Please, do not suggest to migrate to .NET Core. I would migrate to the Sdk style project, but there is another question for that - Is it possible to write VS extensions using the SDK style projects?