Visual Studio “Any CPU” == MSBuild “AnyCPU”

Notice the difference in spacing. You select a build platform named “Any CPU” in Visual Studio 2010 (which is automatically created with your solution), but to target that platform when using msbuild.exe from the command line (or from Nant, or whatever), be sure to leave the space out, and use /p:AnyCPU. If you are using Nant, don’t spend an hour trying to figure out the best way to embed quotation marks in your build file to surround your platform target with spaces such as

“Any CPU”

Because this will not resolve the issue, and you will continue to receive your initial error message:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(539,9): error : The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration=’Dev’ Platform=’Any CPU’

Apparently this is a known issue, a bug with Visual Studio that was brought to light too late in the beta testing process to be fixed before release:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s