MSBuild error - This version of Microsoft.Web.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher. Please install 2.0 or higher of the .NET Core SDK.

MsBuild error publishing ASP.NET MVC referencing .NET Standard library

Breathing new life into a “legacy” ASP.NET website is a way you can help slowly transition the site towards ASP.NET Core. One way you might accomplish that is by referencing .NET Standard libraries. Everything seems fine and dandy until you attempt a publish operation. Generally you might not notice these until running msbuild from command-line–such as in a CI environment, batch deploy script, or otherwise. Let’s talk about one major msbuild error you’ll encounter while publishing your ASP.NET MVC application that references a .NET standard library. We’ll also talk about some other errors that might arise in the process.