4

当使用 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

4

2 回答 2

1

发现更改后,应用程序的项目文件中的一些引用继续引用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')"

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

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

于 2017-06-12T21:21:40.290 回答
1

我在 PCF 控制中遇到了这个错误。

运行开发人员命令提示符 VS2017/VS2019

a) 从您的文件夹中删除空格,例如Test%20-%20PCFs(源代码管理生成的名称)应该是TestPCFs

b) 从 cmd 行转到 pcf 项目文件夹并运行msbuild /t:restore

b) 从 cmd 行转到 cds 项目文件夹并运行msbuild /t:restore

c) 在 cds 项目文件夹中,运行msbuild

d) 对于发布部署运行 msbuild /p:configuration=Release

对于其他类型的项目

a) 从文件夹名称中删除空格

b) 运行msbuild /t:restore

c) 运行msbuild

于 2021-06-04T09:03:11.447 回答