I'm trying to build a UWP project on VSTS (Visual Studio Team Services). When built the following error message occurs and the build fails.
The project "Dummy.Win" is not selected for building in solution configuration "Release|Any CPU".
The solution consists of 3 projects.
Dummy.Winwhich is the UWP project based on 10586
Dummy.Corewhich is a PCL
Dummy.Testwhich is a test project
The following command line shows how
msbuild is called (added some line breaks):
"C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"
"C:\a\1\s\Dummy.sln" /nologo /m /nr:false
The question is: Why is
msbuild trying to build the UWP project for AnyCPU? Running this command locally does not show this error (still doesn't create a .appxupload file but that's another issue)
This may caused by the build platform of other projects in your solution. For example, the "Dummy.Test" project. If it is a general test project instead of a universal windows test project. Then the build platform for it will be "Any CPU" by default. And a build settings with "Release" configuration and "Any CPU" platform will be added to your solution.
Right click on your solution from VS and select "Configuration Manager...", select "Release" for "Active solution configuration:" and "Any CPU" for "Active solution platform:", and then check if the "Build" option of "Dummy.Win" project is checked. If not, check the option and check in the changes and then try the build again.
Open the .SLN solution file with a text editor and find the section SolutionConfigurationPlatforms as shown below. Delete the lines having "Any CPU"
GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|ARM = Debug|ARM Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|ARM = Release|ARM Release|x64 = Release|x64 Release|x86 = Release|x86