MSBuild 将数据附加到配置字符串
我从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
符号
Something1|Something2
用于Configuration|Platform
。因此,对于默认的 C# 项目,您将拥有可能的值,例如Debug|Any CPU
或Release|Any CPU
。从您的片段来看,您似乎正在尝试指定配置和平台。如果是这样,那么您应该这样做:在这种情况下,您需要确保 MySolution.sln 内的所有项目都包含发布配置和定义的“Windows Mobile 5.0 Pocket PC SDK (ARMV4I)”。
这是你需要的吗?我不确定,因为我对您的陈述“我的解决方案中有 Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) 的目标”感到困惑
The notation
Something1|Something2
is forConfiguration|Platform
. So for default C# projects you will have possible values likeDebug|Any CPU
orRelease|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: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"