Doesn't work with projects without an 'AnyCPU' configuration
Most of our VS projects have AnyCPU build configurations removed, instead using specific configurations such as x86 or x64. NuBuild projects seem to want an AnyCPU configuration on projects that are referenced to them.
I think the fix would be to allow NuBuild projects to have other configurations like x86 and x64 so the Platform property can match that of referenced projects.
Here are the steps to reproduce:
- Create a new empty Visual Studio solution.
- Add a new empty C# console application project to the solution.
- Add a new NuBuild project to the solution.
- Add the C# project as a reference to the NuBuild project.
- Ensure NuBuild project builds without error.
- Create an x86 configuration for the C# console application project and the solution.
- Remove the AnyCPU solution configuration and C# console application project configuration (NuBuild project configuration cannot be changed or removed)
- Build the solution.
- Compilation fails with error:
The OutputPath property is not set for project 'NuBuildTest.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.
I'll have to take a look at the mechanism for managing configuration/platforms in the VSSDK. It is not provided by the project node base class. In the short term, you should be able to modify the .nuproj file to include the configuration/platform property groups needed by your projects.
I think the SubType based version could implicitly solve this problem, Solution Properties / Configuration Manager will handle the platforms in the NuBuild projects.
With combined AssignProjectConfiguration and MSBuild tasks it is possible, that the projects referred by the NuBuild project will build with the proper configuration and platform (defined in the .sln or build definition) and not the default AnyCPU. So, the NuBuild project remains AnyCPU, but the referred projects can be set to anything in the Configuration Manager (x64, x86, Win32, etc).