MSBuild 将数据附加到配置字符串

发布于 2024-08-21 17:48:13 字数 774 浏览 5 评论 0原文

我从 MSBuild 中得到了奇怪的行为。

我使用命令:

msbuild.exe /p:Configuration="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" "MySolution.sln" && exit %%ERRORLEVEL%%

它给了我错误:

MySolution.sln:错误 MSB4126:指定的解决方案配置“发布|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)|混合平台”无效。请使用“配置”和“平台”属性(例如 MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU")指定有效的解决方案配置,或将这些属性留空以使用默认解决方案配置。

我的解决方案中有针对 Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) 的目标。我的问题是:为什么 MSBuild 将“|混合平台”附加到我提供的配置中?我怎样才能摆脱这种行为?

我尝试过:

msbuild.exe /p:Configuration=Release "MySolution.sln" && exit %%ERRORLEVEL%%

但它说:

构建解决方案配置“发布|混合平台”。

I am getting strange behavior from MSBuild.

I use the command:

msbuild.exe /p:Configuration="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" "MySolution.sln" && exit %%ERRORLEVEL%%

And it gives me the error:

MySolution.sln : error MSB4126: The specified solution configuration "Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)|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.

There are targets for Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) in my solution. My question is: Why is MSBuild appending "|Mixed Platforms" to the configuration I supplied? How can I get rid of this behavior?

I tried:

msbuild.exe /p:Configuration=Release "MySolution.sln" && exit %%ERRORLEVEL%%

But it said:

Building solution configuration "Release|Mixed Platforms".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弱骨蛰伏 2024-08-28 17:48:13

符号 Something1|Something2 用于 Configuration|Platform。因此,对于默认的 C# 项目,您将拥有可能的值,例如 Debug|Any CPURelease|Any CPU。从您的片段来看,您似乎正在尝试指定配置和平台。如果是这样,那么您应该这样做:

msbuild.exe /p:Configuration="Release",Platform="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" MySolution.sln

在这种情况下,您需要确保 MySolution.sln 内的所有项目都包含发布配置和定义的“Windows Mobile 5.0 Pocket PC SDK (ARMV4I)”。

这是你需要的吗?我不确定,因为我对您的陈述“我的解决方案中有 Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) 的目标”感到困惑

The notation Something1|Something2 is for Configuration|Platform. So for default C# projects you will have possible values like Debug|Any CPU or Release|Any CPU. From your fragment it looks like you are trying to specify both the configuration and the platform. If so then you should do it like:

msbuild.exe /p:Configuration="Release",Platform="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" MySolution.sln

In this case you would need to ensure that all projects inside of the MySolution.sln contains a Release configuration and a "Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" defined.

Is this what you need? I'm not sure because I'm confused about your statement "There are targets for Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) in my solution"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文