指定的解决方案配置“Latest | Any CPU”无效

时间:2013-02-28 10:14:12

标签: msbuild jenkins

我在Jenkins

中运行的MSBuild脚本出现此错误
C:\<path>\<solutionname>.sln.metaproj : error MSB4126: The specified solution
configuration "Latest|Any CPU" is invalid. Please specify a valid solution 
configuration using the Configuration and Platform properties (e.g. MSBuild.exe
Solution.sln
/p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank
to use the default solution configuration.

在Build-&gt;命令行参数下的Jenkins配置中

/t:Deploy /P:Configuration=Latest

我以前在其他项目中使用过这个问题没有任何问题,而且我几乎也有相同的构建文件,但我以前从未见过这个问题。我怀疑,因为唯一不同的是解决方案文件,可能会有不同的东西需要更改。

1 个答案:

答案 0 :(得分:11)

是否存在“最新”配置?默认情况下,Visual Studio在创建新解决方案时会创建2个配置。如果要创建在Visual Studio中使用配置管理器所需的自定义配置,则这些是“调试”和“发布”。

右键单击解决方案资源管理器中的解决方案并选择“配置管理器”,然后您将看到以下UI。这列出了解决方案中的所有项目,它们是什么类型(任何CPU,x86等)以及它们是否应该作为该配置的一部分构建。

Visual Studio Configuration Manager UI

您现在可以创建名为“Latest”的配置,并确定需要为该配置构建的内容。