ASP.NET Core Publish Error (NETSDK1061)

Introduction

將 Visual Studio 2017 升級至 15.8.2 版本後,遠端部署 ASP.NET Core 專案至 IIS 上發生異常狀況:

NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.3-servicing-26724-03 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore. For more information, see https://aka.ms/dotnet-runtime-patch-selection.

Solution

目前已知是 VS2017 15.8.2 版本問題,解決方式為解除安裝 Microsoft .NET Core SDF 2.1.401 (x64)重新安裝即可。

References