views:

227

answers:

1

Hi, I am getting strange behavior from MSBuild.

I use the command:

msbuild.exe /p:Configuration="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" "MySolution.sln" && exit %%ERRORLEVEL%%

And it gives me the error:

MySolution.sln : error MSB4126: The specified solution configuration "Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)|Mixed Platforms" 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.

There are targets for Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) in my solution. My question is: Why is MSBuild appending "|Mixed Platforms" to the configuration I supplied? How can I get rid of this behavior?

I tried:

msbuild.exe /p:Configuration=Release "MySolution.sln" && exit %%ERRORLEVEL%%

But it said:

Building solution configuration "Release|Mixed Platforms".

Thanks for the help,
Fred

A: 

The notation Something1|Something2 is for Configuration|Platform. So for default C# projects you will have possible values like Debug|Any CPU or Release|Any CPU. From your fragment it looks like you are trying to specify both the configuration and the platform. If so then you should do it like:

msbuild.exe /p:Configuration="Release",Platform="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" MySolution.sln

In this case you would need to ensure that all projects inside of the MySolution.sln contains a Release configuration and a "Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" defined.

Is this what you need? I'm not sure because I'm confused about your statement "There are targets for Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) in my solution"

Sayed Ibrahim Hashimi
Thank you for the help. Making sure that each project had a 'Release' and 'Windows Mobile 5.0 Pocket PC SDK (ARMV4I)' defined did the trick.
thefredsmith