Visual Studio Online - “指定的解决方案配置“Debug | any cpu”无效”

5

我需要在Visual Studio Online下构建VS解决方案。但是当我运行它时,出现了一个错误:

C:\a\50009cdf\Mobius-ASG\Prototyping\VCPROJ\SystemAl.sln.metaproj(0,0): Error MSB4126: The specified solution configuration "Debug|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.

我试图将'BuildPlatform'更改为'Mixed Platforms',将'BuildConfiguration'更改为'Release'。 但这并没有帮助我,我得到了相同的错误,但使用了新值:

The specified solution configuration "Release|Mixed Platforms" 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

我也尝试禁用和删除这些变量,但仍然出现相同的错误。我该怎么办呢?


你要在哪里以及如何设置变量? - Vicky - MSFT
我有同样的问题,你解决了吗? - Klinki
我在使用VS Build任务时,在VSTS中遇到了同样的问题。 - Pradeep
1个回答

1

要设置项目的配置和平台,请在解决方案资源管理器中右键单击项目,然后选择“配置管理器”。

在“配置管理器”对话框中,选择所需的配置和平台值。将待处理的更改检入 VSO,并重新运行构建,不带任何参数。现在应该可以成功运行构建。 输入图像描述


1
在我的情况下,构建任务被设置为构建 ***.sln,这会选择 node_modules 中的一个 sln 文件。一旦我将其设置为仅构建我的解决方案,问题就消失了。希望这能帮助到某个人。 - johnstaveley

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接