1
votes

I have created a stock standard solution in Visual Studio for an MVC application.

The default solution configuration contains "Release" and "Debug" with one solution platform named "Any CPU".

When I build the solution using MSBuild in a command prompt (not PowerShell), I get the following error.

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "./Demo1.sln" /verbosity:quiet /nologo

E:\Dev\dotnet\Demo1\Demo1.sln.metaproj : error MSB4126: The specified solution configuration "Debug|X64" 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. [E:\Dev\dotnet\Demo1\Demo1.sln]

I have searched the web and have not found any solutions or even people experiencing the same problem so hoping the SO crowd can help.

Steps to reproduce: 1. Start Visual Studio 2012. 2. File > New Project 3. MVC 4 application. 4. Run "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" Demo1.sln

Thanks in advance.

1

1 Answers

4
votes

If you are running this in the Visual Studio x64 command window it will set an environment variable Platform=x64 that will be used by msbuild. You can verify this by running echo in the command prompt you are using.

echo %platform%

So you will need to override the default when using x64 cmd, or run from the x86 cmd.