指定的解决方案配置“调试|BNB”无效

发布于 2024-10-30 02:58:59 字数 264 浏览 2 评论 0原文

在 Expression Blend 4 中,编译时出现错误:

指定的解决方案配置“Debug|BNB”无效。请使用“配置”和“平台”属性(例如 MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform=”Any CPU”)指定有效的解决方案配置,或将这些属性留空以使用默认解决方案配置。
完成构建项目“myproject.sln”——失败。
构建失败。

In Expression Blend 4, while compiling I get an error saying

The specified solution configuration “Debug|BNB” 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.
Done building project “myproject.sln” — FAILED.
Build failed.

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

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

发布评论

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

评论(4

下雨或天晴 2024-11-06 02:58:59

背景:在构建时,编译器(无论是从 Expression Blend 还是 Visual Studio 启动)必须知道代码的目标平台,即 X86、64 位等系统架构。

现在的问题是,名为“平台”的环境变量的系统范围设置似乎也覆盖了 Expression Blend 用作目标平台的任何设置。

我在其他网站上找到了一些解决方法,并将在这里提供可能的解决方案。尝试两个建议中的一个应该会有所帮助:

  • 在“控制面板--系统--高级--环境变量”中删除冲突的环境变量“平台”。重新启动 Blend 并尝试一下(也许您必须重新启动计算机才能使其工作)。
  • 如果这没有帮助:使用注册表编辑器(开始 - 运行 - “Regedit.exe”)转到键 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment 并选择键 Platform。删除 BNB 值。如果找不到指定的键,请尝试用“ControlSet001”替换“CurrentControlSet”,这在一种情况下也有效。然后重新启动计算机。

请评论哪些解决方案有效。

Background: At build-time the compiler (no matter if started from Expression Blend or Visual Studio) has to know what the target platform of your code, i.e. the system architecture like X86, 64bit etc.

The problem now is, that a system wide setting of an environment variable called "Platform" seems to override any setting of what Expression Blend uses as target platform, too.

I found some workarounds on other websites and will provide the possible solutions here. Trying one of the two suggestions should help:

  • Delete the conflicting environment variable "Platform" in "Control Panel -- System -- Advanced -- Environment Variables". Restart Blend and give it a try (maybe you have to restart your computer to make this work).
  • If this does not help: With the registry editor (Start -- Run -- "Regedit.exe") go to key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and selected the key Platform. Delete the value BNB. If you do not find the specified key, try repacing "CurrentControlSet" with "ControlSet001", this worked for in one case, too. Then restart your computer.

Please give a comment which of the solutions worked.

撩人痒 2024-11-06 02:58:59

我刚刚从环境变量中删除了平台,它就工作了。

I just removed the Platform from Environment variables and it worked.

只是我以为 2024-11-06 02:58:59

使用 Microsoft Visual Studio,以下解决方案应该可以在不重新启动计算机的情况下运行。运行命令行(Windows 键 + R,键入 cmd,按 enter)并键入项目的相应命令:

MSVC 2013:
SET MSBUILD="C:\Program Files Path\MSBuild\12.0\Bin\msbuild.exe"

MSVC 2015:
SET MSBUILD="C:\Program Files Path\MSBuild\14.0\Bin\msbuild.exe"

SET SOLUTION="your solution name.sln"
SET PROJECT="your target project name"
SET MS_PLAT="target platform"
; this could be x64 for 64 bit applications or Win32 for 32 bit applications
%MSBUILD% %SOLUTION% /t:%PROJECT% /p:Platform=%MS_PLAT%

对我来说,PLATFORM = BWS。运行上述脚本一次永久解决了我的项目的问题,无需修改或删除平台。

With Microsoft Visual Studio the following solution should work without restarting your computer. Run the command line (Windows Key + R, type cmd, hit enter) and type the respective commands for your project:

MSVC 2013:
SET MSBUILD="C:\Program Files Path\MSBuild\12.0\Bin\msbuild.exe"

MSVC 2015:
SET MSBUILD="C:\Program Files Path\MSBuild\14.0\Bin\msbuild.exe"

SET SOLUTION="your solution name.sln"
SET PROJECT="your target project name"
SET MS_PLAT="target platform"
; this could be x64 for 64 bit applications or Win32 for 32 bit applications
%MSBUILD% %SOLUTION% /t:%PROJECT% /p:Platform=%MS_PLAT%

For me, PLATFORM = BWS. Running the above script once fixed the problem permanently for my projects, without modifying or deleting PLATFORM.

不喜欢何必死缠烂打 2024-11-06 02:58:59

如果仍然不起作用,请尝试指定配置和平台,

例如

msbuild testproject.sln /p:Configuration=Debug /p:Platform="Any CPU"

这对我有用。

If still not work try to specify configuration and platform

for example

msbuild testproject.sln /p:Configuration=Debug /p:Platform="Any CPU"

This works for me.

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