The specified solution configuration “Debug|BNB” is invalid

前端 未结 4 1014
难免孤独
难免孤独 2021-02-18 20:05

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

The specified solution configuration “Debug|BNB” is invalid. Please specify a valid solution

相关标签:
4条回答
  • 2021-02-18 20:19

    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.

    0 讨论(0)
  • 2021-02-18 20:19

    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.

    0 讨论(0)
  • 2021-02-18 20:24

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

    0 讨论(0)
  • 2021-02-18 20:32

    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.

    0 讨论(0)
提交回复
热议问题