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.

Windows cannot be installed to this disk 0x80300001 in Windows 7 Setup

When installing Windows 7 onto Gigabyte SATA RAID, I got two errors:

  • Windows cannot be installed to this disk 0x80300001
  • Windows is unable to install to the selected location. Error: 0x80300001

Windows Setup sees the RAID volume, and one of the errors appears when you create partition manually.

The error is shown after you have inserted RAID driver CD / DVD and Windows have loaded it.

After one lost hour I figured out that you need to insert back Windows installation DVD disk and click Refresh. Error goes away after refresh.

x64 C# warning – Referenced assembly ‘System.Data.dll’ targets a different processor

Using Visual Studio 2010 C# to compile .NET project for Target Platform x64, the following two warnings appears:

------ Rebuild All started: Project: TestProject-64-bit, Configuration: Debug x64 ------
warning CS1607: Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor
warning CS1607: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor

Compile complete -- 0 errors, 2 warnings
Manager -> P:\Project Files\TestProject-64-bit\Test-x64.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

It is a bug in Visual Studio 2010, and warnings can be safely ignored. There are some bugs already filled in MS Connect. Suggestion is:
Edit the project file directly. Replace the references that are having this problem with explicit paths to the 64 bit ones, eg.,:
<Reference Include="$(Windir)\Microsoft.NET\Framework64\v2.0.50727\system.data.dll" />
<Reference Include="$(Windir)\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll"/>

Great suggestion, but it won’t work if you need to compile / build both for x86 and x64 platforms. And that is what I need.

MSDN Forum post suggests to disable warning:
Parameters Tab - Advanced - MSBuild Arguments, type /p:NoWarn=1607

It seems, that it is for Team Edition, it does not make sense for me, so I use:
Properties - Build - Suppress warnings: 1607

Currently must live with this hack, if you need to target both 32 and 64-bit platforms. Hope the fix will be released so we can remove warning suppression.