VS2010: Project not selected to build for this solution configuration

Along with everyone we are moving towards 64-bit platforms. After adding solution platform x64 under Visual Studio 2010 Configuration Manager, everything seemed ok.

When building, all builds was successful except x64 Release. Here is an output:
1>------ Skipped Build: Project: abc, Configuration: Release x64 ------
1>Project not selected to build for this solution configuration
2>------ Skipped Build: Project: def, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration
...
========== Build: 1 succeeded or up-to-date, 0 failed, 27 skipped ==========

After some digging I found that solution file (.sln) is damaged. Some forum posts suggest to recreate solution and add all project again.

Then if you compare old (broken) .sln file and new .sln file, you notice that old file is missing some ‘Build.0’ entries for x64 platform:
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.ActiveCfg = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.Build.0 = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.ActiveCfg = Debug|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.ActiveCfg = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.Build.0 = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.ActiveCfg = Release|x64

To fix, add the missing entries:
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.ActiveCfg = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.Build.0 = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.ActiveCfg = Debug|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.Build.0 = Debug|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.ActiveCfg = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.Build.0 = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.ActiveCfg = Release|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.Build.0 = Release|x64

If you have MS Setup Projects (MSI), then you will have 8 entries without final platform specifier:
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.ActiveCfg = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.Build.0 = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.ActiveCfg = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.Build.0 = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.ActiveCfg = Release
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.Build.0 = Release
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.ActiveCfg = Release
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.Build.0 = Release

If you have relatively small number of project I suggest you to go with recreating solution path, because it is very easy to make mistake by editing .sln in text editor.

10 replies on “VS2010: Project not selected to build for this solution configuration”

  1. Build -> Configuration Manager

    Make sure that all assemblies are selected for build for your given target plattforms..

  2. You can also do it the following way.
    Click on the Solution name in Solution Explorer.
    Next click on Build -> Configuration Manager.
    You will notice that the projects that were skipped doesn’t have a tick under the Build column. Check all the boxes and click “Close”.
    Now try building the solution again.

Comments are closed.