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

Sac*_*nth 7 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.
Run Code Online (Sandbox Code Playgroud)

我在Build-> Command Line Arguments下的Jenkins配置中

/t:Deploy /P:Configuration=Latest
Run Code Online (Sandbox Code Playgroud)

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

Jam*_*eed 12

"最新"配置是否存在?默认情况下,Visual Studio在创建新解决方案时会创建2个配置.如果要创建在Visual Studio中使用Configuration Manager所需的自定义配置,则这些是"Debug"和"Release".

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

Visual Studio Configuration Manager UI

您现在可以创建一个名为"Latest"的配置,并决定需要为该配置构建什么.

  • 我的问题是忘记为我的新配置检查web.config转换. (2认同)