VS2017 MSB4057 项目中不存在目标“CreateManifestResourceNames”

Rob*_*ert 5 msbuild visual-studio azure-service-fabric

当使用 VS2017 创建有状态解决方案并生成标准样板代码时,生成的两个项目具有两个不同的 MSBuild 版本。该应用程序使用 MSBuild 版本 1.5.0。该服务使用 MSBuild 版本 1.6.0(当前“最新”)。

如果我以这种方式运行该解决方案,它在我的本地 Service Fabric 群集上运行良好。

但是,当我使用 NuGet 将应用程序的 MSBuild 更新到 1.6.0 后(因此应用程序和服务器项目都使用相同的版本),会出现以下错误。


Severity Code Description Project File Line Suppression State
Error  The OutputPath property is not set for project 'gt_strd5.sfproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  P follow a project-to-project reference to this project, this project has belatform='x64'.  This error may also appear if some other project is trying toen unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. gt_strd5 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 737 

Severity Code Description Project File Line Suppression State
Error MSB4057 The target "CreateManifestResourceNames" does not exist in the project. gt_strd5 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 2630
Run Code Online (Sandbox Code Playgroud)

Rob*_*ert 2

我发现更改后,应用程序的项目文件中的一些引用继续引用MSBuild 1.5.0。就我而言,gt_strd5.sfproj 文件包含四个引用,需要从 1.5.0 更新到 1.6.0。请参阅下面的 XML 片段。

Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.**MSBuild.1.5.0**\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.**MSBuild.1.5.0**\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')"
.....
Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.**MSBuild.1.5.0**\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.**MSBuild.1.5.0**\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')"
Run Code Online (Sandbox Code Playgroud)

为了验证这一点,我回去了几次并且能够重现该问题和该解决方案。

希望它可以节省其他人的时间。此致